From eaa08e0c550e80b4947e9de5744665ce82ac050f Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Tue, 4 Oct 2022 10:35:37 -0700 Subject: [PATCH 01/26] Adding the Vector512 and Vector512 types --- .../System.Private.CoreLib.Shared.projitems | 3 + .../System/Runtime/Intrinsics/Vector256.cs | 47 +- .../System/Runtime/Intrinsics/Vector512.cs | 3107 ++++++++++ .../Intrinsics/Vector512DebugView_1.cs | 138 + .../System/Runtime/Intrinsics/Vector512_1.cs | 391 ++ .../src/System/ThrowHelper.cs | 13 + .../ref/System.Runtime.Intrinsics.cs | 289 + .../System.Runtime.Intrinsics.Tests.csproj | 1 + .../tests/Vectors/Vector512Tests.cs | 5088 +++++++++++++++++ 9 files changed, 9072 insertions(+), 5 deletions(-) create mode 100644 src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs create mode 100644 src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512DebugView_1.cs create mode 100644 src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs create mode 100644 src/libraries/System.Runtime.Intrinsics/tests/Vectors/Vector512Tests.cs diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems index 211c20005ebbd6..2fbe72721a0b0c 100644 --- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems +++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems @@ -927,6 +927,9 @@ + + + diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs index fbf87d31980ea3..9c6dfd360c0200 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs @@ -241,7 +241,7 @@ public static Vector256 AsUInt32(this Vector256 vector) public static Vector256 AsUInt64(this Vector256 vector) where T : struct => vector.As(); - /// Reinterprets a as a new . + /// Reinterprets a as a new . /// The type of the elements in the vector. /// The vector to reinterpret. /// reinterpreted as a new . @@ -259,10 +259,10 @@ public static Vector256 AsVector256(this Vector value) return result; } - /// Reinterprets a as a new . + /// Reinterprets a as a new . /// The type of the elements in the vector. /// The vector to reinterpret. - /// reinterpreted as a new . + /// reinterpreted as a new . /// The type of () is not supported. [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -826,7 +826,8 @@ public static Vector256 Create(ReadOnlySpan values) /// On x86, this method corresponds to __m256i _mm256_setr_epi8 [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector256 Create(byte e0, byte e1, byte e2, byte e3, byte e4, byte e5, byte e6, byte e7, byte e8, byte e9, byte e10, byte e11, byte e12, byte e13, byte e14, byte e15, byte e16, byte e17, byte e18, byte e19, byte e20, byte e21, byte e22, byte e23, byte e24, byte e25, byte e26, byte e27, byte e28, byte e29, byte e30, byte e31) + public static Vector256 Create(byte e0, byte e1, byte e2, byte e3, byte e4, byte e5, byte e6, byte e7, byte e8, byte e9, byte e10, byte e11, byte e12, byte e13, byte e14, byte e15, + byte e16, byte e17, byte e18, byte e19, byte e20, byte e21, byte e22, byte e23, byte e24, byte e25, byte e26, byte e27, byte e28, byte e29, byte e30, byte e31) { return Create( Vector128.Create(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15), @@ -956,7 +957,8 @@ public static Vector256 Create(long e0, long e1, long e2, long e3) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector256 Create(sbyte e0, sbyte e1, sbyte e2, sbyte e3, sbyte e4, sbyte e5, sbyte e6, sbyte e7, sbyte e8, sbyte e9, sbyte e10, sbyte e11, sbyte e12, sbyte e13, sbyte e14, sbyte e15, sbyte e16, sbyte e17, sbyte e18, sbyte e19, sbyte e20, sbyte e21, sbyte e22, sbyte e23, sbyte e24, sbyte e25, sbyte e26, sbyte e27, sbyte e28, sbyte e29, sbyte e30, sbyte e31) + public static Vector256 Create(sbyte e0, sbyte e1, sbyte e2, sbyte e3, sbyte e4, sbyte e5, sbyte e6, sbyte e7, sbyte e8, sbyte e9, sbyte e10, sbyte e11, sbyte e12, sbyte e13, sbyte e14, sbyte e15, + sbyte e16, sbyte e17, sbyte e18, sbyte e19, sbyte e20, sbyte e21, sbyte e22, sbyte e23, sbyte e24, sbyte e25, sbyte e26, sbyte e27, sbyte e28, sbyte e29, sbyte e30, sbyte e31) { return Create( Vector128.Create(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15), @@ -2794,6 +2796,41 @@ public static T ToScalar(this Vector256 vector) return vector.GetElementUnsafe(0); } + /// Converts the given vector to a new with the lower 256-bits set to the value of the given vector and the upper 256-bits initialized to zero. + /// The type of the input vector. + /// The vector to extend. + /// A new with the lower 256-bits set to the value of and the upper 256-bits initialized to zero. + /// The type of () is not supported. + [Intrinsic] + public static Vector512 ToVector512(this Vector256 vector) + where T : struct + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector256BaseType(); + + Vector512 result = default; + result.SetLowerUnsafe(vector); + return result; + } + + /// Converts the given vector to a new with the lower 256-bits set to the value of the given vector and the upper 256-bits left uninitialized. + /// The type of the input vector. + /// The vector to extend. + /// A new with the lower 256-bits set to the value of and the upper 256-bits left uninitialized. + /// The type of () is not supported. + [Intrinsic] + public static unsafe Vector512 ToVector512Unsafe(this Vector256 vector) + where T : struct + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector256BaseType(); + + // This relies on us stripping the "init" flag from the ".locals" + // declaration to let the upper bits be uninitialized. + + Unsafe.SkipInit(out Vector512 result); + result.SetLowerUnsafe(vector); + return result; + } + /// Tries to copy a to a given span. /// The type of the input vector. /// The vector to copy. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs new file mode 100644 index 00000000000000..908366b5f8d62a --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs @@ -0,0 +1,3107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics.X86; + +namespace System.Runtime.Intrinsics +{ + // We mark certain methods with AggressiveInlining to ensure that the JIT will + // inline them. The JIT would otherwise not inline the method since it, at the + // point it tries to determine inline profability, currently cannot determine + // that most of the code-paths will be optimized away as "dead code". + // + // We then manually inline cases (such as certain intrinsic code-paths) that + // will generate code small enough to make the AgressiveInlining profitable. The + // other cases (such as the software fallback) are placed in their own method. + // This ensures we get good codegen for the "fast-path" and allows the JIT to + // determine inline profitability of the other paths as it would normally. + + // Many of the instance methods were moved to be extension methods as it results + // in overall better codegen. This is because instance methods require the C# compiler + // to generate extra locals as the `this` parameter has to be passed by reference. + // Having them be extension methods means that the `this` parameter can be passed by + // value instead, thus reducing the number of locals and helping prevent us from hitting + // the internal inlining limits of the JIT. + + /// Provides a collection of static methods for creating, manipulating, and otherwise operting on 512-bit vectors. + public static unsafe class Vector512 + { + internal const int Size = 64; + +#if TARGET_ARM + internal const int Alignment = 8; +#elif TARGET_ARM64 + internal const int Alignment = 16; +#else + internal const int Alignment = 64; +#endif + + /// Gets a value that indicates whether 512-bit vector operations are subject to hardware acceleration through JIT intrinsic support. + /// if 512-bit vector operations are subject to hardware acceleration; otherwise, . + /// 512-bit vector operations are subject to hardware acceleration on systems that support Single Instruction, Multiple Data (SIMD) instructions for 512-bit vectors and the RyuJIT just-in-time compiler is used to compile managed code. + public static bool IsHardwareAccelerated + { + [Intrinsic] + get => IsHardwareAccelerated; + } + + /// Computes the absolute value of each element in a vector. + /// The type of the elements in the vector. + /// The vector that will have its absolute value computed. + /// A vector whose elements are the absolute value of the elements in . + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Abs(Vector512 vector) + where T : struct + { + return Create( + Vector256.Abs(vector._lower), + Vector256.Abs(vector._upper) + ); + } + + /// Adds two vectors to compute their sum. + /// The type of the elements in the vector. + /// The vector to add with . + /// The vector to add with . + /// The sum of and . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Add(Vector512 left, Vector512 right) + where T : struct => left + right; + + /// Computes the bitwise-and of a given vector and the ones complement of another vector. + /// The type of the elements in the vector. + /// The vector to bitwise-and with . + /// The vector to that is ones-complemented before being bitwise-and with . + /// The bitwise-and of and the ones-complement of . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 AndNot(Vector512 left, Vector512 right) + where T : struct + { + return Create( + Vector256.AndNot(left._lower, right._lower), + Vector256.AndNot(left._upper, right._upper) + ); + } + + /// Reinterprets a as a new . + /// The type of the elements in the input vector. + /// The type of the elements in the output vector. + /// The vector to reinterpret. + /// reinterpreted as a new . + /// The type of () or the type of the target () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 As(this Vector512 vector) + where TFrom : struct + where TTo : struct + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + + return Unsafe.As, Vector512>(ref vector); + } + + /// Reinterprets a as a new . + /// The type of the elements in the vector. + /// The vector to reinterpret. + /// reinterpreted as a new . + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 AsByte(this Vector512 vector) + where T : struct => vector.As(); + + /// Reinterprets a as a new . + /// The type of the elements in the vector. + /// The vector to reinterpret. + /// reinterpreted as a new . + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 AsDouble(this Vector512 vector) + where T : struct => vector.As(); + + /// Reinterprets a as a new . + /// The type of the elements in the vector. + /// The vector to reinterpret. + /// reinterpreted as a new . + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 AsInt16(this Vector512 vector) + where T : struct => vector.As(); + + /// Reinterprets a as a new . + /// The type of the elements in the vector. + /// The vector to reinterpret. + /// reinterpreted as a new . + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 AsInt32(this Vector512 vector) + where T : struct => vector.As(); + + /// Reinterprets a as a new . + /// The type of the elements in the vector. + /// The vector to reinterpret. + /// reinterpreted as a new . + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 AsInt64(this Vector512 vector) + where T : struct => vector.As(); + + /// Reinterprets a as a new . + /// The type of the elements in the vector. + /// The vector to reinterpret. + /// reinterpreted as a new . + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 AsNInt(this Vector512 vector) + where T : struct => vector.As(); + + /// Reinterprets a as a new . + /// The type of the elements in the vector. + /// The vector to reinterpret. + /// reinterpreted as a new . + /// The type of () is not supported. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 AsNUInt(this Vector512 vector) + where T : struct => vector.As(); + + /// Reinterprets a as a new . + /// The type of the elements in the vector. + /// The vector to reinterpret. + /// reinterpreted as a new . + /// The type of () is not supported. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 AsSByte(this Vector512 vector) + where T : struct => vector.As(); + + /// Reinterprets a as a new . + /// The type of the elements in the vector. + /// The vector to reinterpret. + /// reinterpreted as a new . + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 AsSingle(this Vector512 vector) + where T : struct => vector.As(); + + /// Reinterprets a as a new . + /// The type of the elements in the vector. + /// The vector to reinterpret. + /// reinterpreted as a new . + /// The type of () is not supported. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 AsUInt16(this Vector512 vector) + where T : struct => vector.As(); + + /// Reinterprets a as a new . + /// The type of the elements in the vector. + /// The vector to reinterpret. + /// reinterpreted as a new . + /// The type of () is not supported. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 AsUInt32(this Vector512 vector) + where T : struct => vector.As(); + + /// Reinterprets a as a new . + /// The type of the elements in the vector. + /// The vector to reinterpret. + /// reinterpreted as a new . + /// The type of () is not supported. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 AsUInt64(this Vector512 vector) + where T : struct => vector.As(); + + /// Reinterprets a as a new . + /// The type of the elements in the vector. + /// The vector to reinterpret. + /// reinterpreted as a new . + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 AsVector512(this Vector value) + where T : struct + { + Debug.Assert(Vector512.Count >= Vector.Count); + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + + Vector512 result = default; + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); + return result; + } + + /// Reinterprets a as a new . + /// The type of the elements in the vector. + /// The vector to reinterpret. + /// reinterpreted as a new . + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector AsVector(this Vector512 value) + where T : struct + { + Debug.Assert(Vector512.Count >= Vector.Count); + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + + ref byte address = ref Unsafe.As, byte>(ref value); + return Unsafe.ReadUnaligned>(ref address); + } + + /// Computes the bitwise-and of two vectors. + /// The type of the elements in the vector. + /// The vector to bitwise-and with . + /// The vector to bitwise-and with . + /// The bitwise-and of and . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 BitwiseAnd(Vector512 left, Vector512 right) + where T : struct => left & right; + + /// Computes the bitwise-or of two vectors. + /// The type of the elements in the vector. + /// The vector to bitwise-or with . + /// The vector to bitwise-or with . + /// The bitwise-or of and . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 BitwiseOr(Vector512 left, Vector512 right) + where T : struct => left | right; + + /// Computes the ceiling of each element in a vector. + /// The vector that will have its ceiling computed. + /// A vector whose elements are the ceiling of the elements in . + /// + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Ceiling(Vector512 vector) + { + return Create( + Vector256.Ceiling(vector._lower), + Vector256.Ceiling(vector._upper) + ); + } + + /// Computes the ceiling of each element in a vector. + /// The vector that will have its ceiling computed. + /// A vector whose elements are the ceiling of the elements in . + /// + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Ceiling(Vector512 vector) + { + return Create( + Vector256.Ceiling(vector._lower), + Vector256.Ceiling(vector._upper) + ); + } + + /// Conditionally selects a value from two vectors on a bitwise basis. + /// The type of the elements in the vector. + /// The mask that is used to select a value from or . + /// The vector that is selected when the corresponding bit in is one. + /// The vector that is selected when the corresponding bit in is zero. + /// A vector whose bits come from or based on the value of . + /// The type of , , and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ConditionalSelect(Vector512 condition, Vector512 left, Vector512 right) + where T : struct + { + return Create( + Vector256.ConditionalSelect(condition._lower, left._lower, right._lower), + Vector256.ConditionalSelect(condition._upper, left._upper, right._upper) + ); + } + + /// Converts a to a . + /// The vector to convert. + /// The converted vector. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ConvertToDouble(Vector512 vector) + { + return Create( + Vector256.ConvertToDouble(vector._lower), + Vector256.ConvertToDouble(vector._upper) + ); + } + + /// Converts a to a . + /// The vector to convert. + /// The converted vector. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ConvertToDouble(Vector512 vector) + { + return Create( + Vector256.ConvertToDouble(vector._lower), + Vector256.ConvertToDouble(vector._upper) + ); + } + + /// Converts a to a . + /// The vector to convert. + /// The converted vector. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ConvertToInt32(Vector512 vector) + { + return Create( + Vector256.ConvertToInt32(vector._lower), + Vector256.ConvertToInt32(vector._upper) + ); + } + + /// Converts a to a . + /// The vector to convert. + /// The converted vector. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ConvertToInt64(Vector512 vector) + { + return Create( + Vector256.ConvertToInt64(vector._lower), + Vector256.ConvertToInt64(vector._upper) + ); + } + + /// Converts a to a . + /// The vector to convert. + /// The converted vector. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ConvertToSingle(Vector512 vector) + { + return Create( + Vector256.ConvertToSingle(vector._lower), + Vector256.ConvertToSingle(vector._upper) + ); + } + + /// Converts a to a . + /// The vector to convert. + /// The converted vector. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ConvertToSingle(Vector512 vector) + { + return Create( + Vector256.ConvertToSingle(vector._lower), + Vector256.ConvertToSingle(vector._upper) + ); + } + + /// Converts a to a . + /// The vector to convert. + /// The converted vector. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ConvertToUInt32(Vector512 vector) + { + return Create( + Vector256.ConvertToUInt32(vector._lower), + Vector256.ConvertToUInt32(vector._upper) + ); + } + + /// Converts a to a . + /// The vector to convert. + /// The converted vector. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ConvertToUInt64(Vector512 vector) + { + return Create( + Vector256.ConvertToUInt64(vector._lower), + Vector256.ConvertToUInt64(vector._upper) + ); + } + + /// Copies a to a given array. + /// The type of the elements in the vector. + /// The vector to be copied. + /// The array to which is copied. + /// The length of is less than . + /// The type of and () is not supported. + /// is null. + public static void CopyTo(this Vector512 vector, T[] destination) + where T : struct + { + // We explicitly don't check for `null` because historically this has thrown `NullReferenceException` for perf reasons + + if (destination.Length < Vector512.Count) + { + ThrowHelper.ThrowArgumentException_DestinationTooShort(); + } + + ref byte address = ref Unsafe.As(ref MemoryMarshal.GetArrayDataReference(destination)); + Unsafe.WriteUnaligned(ref address, vector); + } + + /// Copies a to a given array starting at the specified index. + /// The type of the elements in the vector. + /// The vector to be copied. + /// The array to which is copied. + /// The starting index of which will be copied to. + /// The length of is less than . + /// is negative or greater than the length of . + /// The type of and () is not supported. + /// is null. + public static void CopyTo(this Vector512 vector, T[] destination, int startIndex) + where T : struct + { + // We explicitly don't check for `null` because historically this has thrown `NullReferenceException` for perf reasons + + if ((uint)startIndex >= (uint)destination.Length) + { + ThrowHelper.ThrowStartIndexArgumentOutOfRange_ArgumentOutOfRange_IndexMustBeLess(); + } + + if ((destination.Length - startIndex) < Vector512.Count) + { + ThrowHelper.ThrowArgumentException_DestinationTooShort(); + } + + ref byte address = ref Unsafe.As(ref MemoryMarshal.GetArrayDataReference(destination)); + Unsafe.WriteUnaligned(ref Unsafe.Add(ref address, startIndex), vector); + } + + /// Copies a to a given span. + /// The type of the elements in the vector. + /// The vector to be copied. + /// The span to which the is copied. + /// The length of is less than . + /// The type of and () is not supported. + public static void CopyTo(this Vector512 vector, Span destination) + where T : struct + { + if ((uint)destination.Length < (uint)Vector512.Count) + { + ThrowHelper.ThrowArgumentException_DestinationTooShort(); + } + + ref byte address = ref Unsafe.As(ref MemoryMarshal.GetReference(destination)); + Unsafe.WriteUnaligned(ref address, vector); + } + + /// Creates a new instance with all elements initialized to the specified value. + /// The type of the elements in the vector. + /// The value that all elements will be initialized to. + /// A new with all elements initialized to . + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(T value) + where T : struct + { + Vector256 vector = Vector256.Create(value); + return Create(vector, vector); + } + + /// Creates a new instance with all elements initialized to the specified value. + /// The value that all elements will be initialized to. + /// A new with all elements initialized to . + /// On x86, this method corresponds to __m512i _mm512_set1_epi8 + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(byte value) => Create(value); + + /// Creates a new instance with all elements initialized to the specified value. + /// The value that all elements will be initialized to. + /// A new with all elements initialized to . + /// On x86, this method corresponds to __m512d _mm512_set1_pd + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(double value) => Create(value); + + /// Creates a new instance with all elements initialized to the specified value. + /// The value that all elements will be initialized to. + /// A new with all elements initialized to . + /// On x86, this method corresponds to __m512i _mm512_set1_epi16 + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(short value) => Create(value); + + /// Creates a new instance with all elements initialized to the specified value. + /// The value that all elements will be initialized to. + /// A new with all elements initialized to . + /// On x86, this method corresponds to __m512i _mm512_set1_epi32 + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(int value) => Create(value); + + /// Creates a new instance with all elements initialized to the specified value. + /// The value that all elements will be initialized to. + /// A new with all elements initialized to . + /// On x86, this method corresponds to __m512i _mm512_set1_epi64x + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(long value) => Create(value); + + /// Creates a new instance with all elements initialized to the specified value. + /// The value that all elements will be initialized to. + /// A new with all elements initialized to . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(nint value) => Create(value); + + /// Creates a new instance with all elements initialized to the specified value. + /// The value that all elements will be initialized to. + /// A new with all elements initialized to . + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(nuint value) => Create(value); + + /// Creates a new instance with all elements initialized to the specified value. + /// The value that all elements will be initialized to. + /// A new with all elements initialized to . + /// On x86, this method corresponds to __m512i _mm512_set1_epi8 + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(sbyte value) => Create(value); + + /// Creates a new instance with all elements initialized to the specified value. + /// The value that all elements will be initialized to. + /// A new with all elements initialized to . + /// On x86, this method corresponds to __m512 _mm512_set1_ps + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(float value) => Create(value); + + /// Creates a new instance with all elements initialized to the specified value. + /// The value that all elements will be initialized to. + /// A new with all elements initialized to . + /// On x86, this method corresponds to __m512i _mm512_set1_epi16 + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(ushort value) => Create(value); + + /// Creates a new instance with all elements initialized to the specified value. + /// The value that all elements will be initialized to. + /// A new with all elements initialized to . + /// On x86, this method corresponds to __m512i _mm512_set1_epi32 + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(uint value) => Create(value); + + /// Creates a new instance with all elements initialized to the specified value. + /// The value that all elements will be initialized to. + /// A new with all elements initialized to . + /// On x86, this method corresponds to __m512i _mm512_set1_epi64x + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(ulong value) => Create(value); + + /// Creates a new from a given array. + /// The type of the elements in the vector. + /// The array from which the vector is created. + /// A new with its elements set to the first elements from . + /// The length of is less than . + /// The type of () is not supported. + /// is null. + public static Vector512 Create(T[] values) + where T : struct + { + // We explicitly don't check for `null` because historically this has thrown `NullReferenceException` for perf reasons + + if (values.Length < Vector512.Count) + { + ThrowHelper.ThrowArgumentOutOfRange_IndexMustBeLessOrEqualException(); + } + + ref byte address = ref Unsafe.As(ref MemoryMarshal.GetArrayDataReference(values)); + return Unsafe.ReadUnaligned>(ref address); + } + + /// Creates a new from a given array. + /// The type of the elements in the vector. + /// The array from which the vector is created. + /// The index in at which to being reading elements. + /// A new with its elements set to the first elements from . + /// The length of , starting from , is less than . + /// The type of () is not supported. + /// is null. + public static Vector512 Create(T[] values, int index) + where T : struct + { + // We explicitly don't check for `null` because historically this has thrown `NullReferenceException` for perf reasons + + if ((index < 0) || ((values.Length - index) < Vector512.Count)) + { + ThrowHelper.ThrowArgumentOutOfRange_IndexMustBeLessOrEqualException(); + } + + ref byte address = ref Unsafe.As(ref MemoryMarshal.GetArrayDataReference(values)); + return Unsafe.ReadUnaligned>(ref Unsafe.Add(ref address, index)); + } + + /// Creates a new from a given readonly span. + /// The type of the elements in the vector. + /// The readonly span from which the vector is created. + /// A new with its elements set to the first elements from . + /// The length of is less than . + /// The type of () is not supported. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(ReadOnlySpan values) + where T : struct + { + if (values.Length < Vector512.Count) + { + ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.values); + } + + ref byte address = ref Unsafe.As(ref MemoryMarshal.GetReference(values)); + return Unsafe.ReadUnaligned>(ref address); + } + + /// Creates a new instance with each element initialized to the corresponding specified value. + /// The value that element 0 will be initialized to. + /// The value that element 1 will be initialized to. + /// The value that element 2 will be initialized to. + /// The value that element 3 will be initialized to. + /// The value that element 4 will be initialized to. + /// The value that element 5 will be initialized to. + /// The value that element 6 will be initialized to. + /// The value that element 7 will be initialized to. + /// The value that element 8 will be initialized to. + /// The value that element 9 will be initialized to. + /// The value that element 10 will be initialized to. + /// The value that element 11 will be initialized to. + /// The value that element 12 will be initialized to. + /// The value that element 13 will be initialized to. + /// The value that element 14 will be initialized to. + /// The value that element 15 will be initialized to. + /// The value that element 16 will be initialized to. + /// The value that element 17 will be initialized to. + /// The value that element 18 will be initialized to. + /// The value that element 19 will be initialized to. + /// The value that element 20 will be initialized to. + /// The value that element 21 will be initialized to. + /// The value that element 22 will be initialized to. + /// The value that element 23 will be initialized to. + /// The value that element 24 will be initialized to. + /// The value that element 25 will be initialized to. + /// The value that element 26 will be initialized to. + /// The value that element 27 will be initialized to. + /// The value that element 28 will be initialized to. + /// The value that element 29 will be initialized to. + /// The value that element 30 will be initialized to. + /// The value that element 31 will be initialized to. + /// The value that element 32 will be initialized to. + /// The value that element 33 will be initialized to. + /// The value that element 34 will be initialized to. + /// The value that element 35 will be initialized to. + /// The value that element 36 will be initialized to. + /// The value that element 37 will be initialized to. + /// The value that element 38 will be initialized to. + /// The value that element 39 will be initialized to. + /// The value that element 40 will be initialized to. + /// The value that element 41 will be initialized to. + /// The value that element 42 will be initialized to. + /// The value that element 43 will be initialized to. + /// The value that element 44 will be initialized to. + /// The value that element 45 will be initialized to. + /// The value that element 46 will be initialized to. + /// The value that element 47 will be initialized to. + /// The value that element 48 will be initialized to. + /// The value that element 49 will be initialized to. + /// The value that element 50 will be initialized to. + /// The value that element 51 will be initialized to. + /// The value that element 52 will be initialized to. + /// The value that element 53 will be initialized to. + /// The value that element 54 will be initialized to. + /// The value that element 55 will be initialized to. + /// The value that element 56 will be initialized to. + /// The value that element 57 will be initialized to. + /// The value that element 58 will be initialized to. + /// The value that element 59 will be initialized to. + /// The value that element 60 will be initialized to. + /// The value that element 61 will be initialized to. + /// The value that element 62 will be initialized to. + /// The value that element 63 will be initialized to. + /// A new with each element initialized to corresponding specified value. + /// On x86, this method corresponds to __m512i _mm512_setr_epi8 + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(byte e0, byte e1, byte e2, byte e3, byte e4, byte e5, byte e6, byte e7, byte e8, byte e9, byte e10, byte e11, byte e12, byte e13, byte e14, byte e15, + byte e16, byte e17, byte e18, byte e19, byte e20, byte e21, byte e22, byte e23, byte e24, byte e25, byte e26, byte e27, byte e28, byte e29, byte e30, byte e31, + byte e32, byte e33, byte e34, byte e35, byte e36, byte e37, byte e38, byte e39, byte e40, byte e41, byte e42, byte e43, byte e44, byte e45, byte e46, byte e47, + byte e48, byte e49, byte e50, byte e51, byte e52, byte e53, byte e54, byte e55, byte e56, byte e57, byte e58, byte e59, byte e60, byte e61, byte e62, byte e63) + { + return Create( + Vector256.Create(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31), + Vector256.Create(e32, e33, e34, e35, e36, e37, e38, e39, e40, e41, e42, e43, e44, e45, e46, e47, e48, e49, e50, e51, e52, e53, e54, e55, e56, e57, e58, e59, e60, e61, e62, e63) + ); + } + + /// Creates a new instance with each element initialized to the corresponding specified value. + /// The value that element 0 will be initialized to. + /// The value that element 1 will be initialized to. + /// The value that element 2 will be initialized to. + /// The value that element 3 will be initialized to. + /// The value that element 4 will be initialized to. + /// The value that element 5 will be initialized to. + /// The value that element 6 will be initialized to. + /// The value that element 7 will be initialized to. + /// A new with each element initialized to corresponding specified value. + /// On x86, this method corresponds to __m512d _mm512_setr_pd + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(double e0, double e1, double e2, double e3, double e4, double e5, double e6, double e7) + { + return Create( + Vector256.Create(e0, e1, e2, e3), + Vector256.Create(e4, e5, e6, e7) + ); + } + + /// Creates a new instance with each element initialized to the corresponding specified value. + /// The value that element 0 will be initialized to. + /// The value that element 1 will be initialized to. + /// The value that element 2 will be initialized to. + /// The value that element 3 will be initialized to. + /// The value that element 4 will be initialized to. + /// The value that element 5 will be initialized to. + /// The value that element 6 will be initialized to. + /// The value that element 7 will be initialized to. + /// The value that element 8 will be initialized to. + /// The value that element 9 will be initialized to. + /// The value that element 10 will be initialized to. + /// The value that element 11 will be initialized to. + /// The value that element 12 will be initialized to. + /// The value that element 13 will be initialized to. + /// The value that element 14 will be initialized to. + /// The value that element 15 will be initialized to. + /// The value that element 16 will be initialized to. + /// The value that element 17 will be initialized to. + /// The value that element 18 will be initialized to. + /// The value that element 19 will be initialized to. + /// The value that element 20 will be initialized to. + /// The value that element 21 will be initialized to. + /// The value that element 22 will be initialized to. + /// The value that element 23 will be initialized to. + /// The value that element 24 will be initialized to. + /// The value that element 25 will be initialized to. + /// The value that element 26 will be initialized to. + /// The value that element 27 will be initialized to. + /// The value that element 28 will be initialized to. + /// The value that element 29 will be initialized to. + /// The value that element 30 will be initialized to. + /// The value that element 31 will be initialized to. + /// A new with each element initialized to corresponding specified value. + /// On x86, this method corresponds to __m512i _mm512_setr_epi16 + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(short e0, short e1, short e2, short e3, short e4, short e5, short e6, short e7, short e8, short e9, short e10, short e11, short e12, short e13, short e14, short e15, + short e16, short e17, short e18, short e19, short e20, short e21, short e22, short e23, short e24, short e25, short e26, short e27, short e28, short e29, short e30, short e31) + { + return Create( + Vector256.Create(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15), + Vector256.Create(e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31) + ); + } + + /// Creates a new instance with each element initialized to the corresponding specified value. + /// The value that element 0 will be initialized to. + /// The value that element 1 will be initialized to. + /// The value that element 2 will be initialized to. + /// The value that element 3 will be initialized to. + /// The value that element 4 will be initialized to. + /// The value that element 5 will be initialized to. + /// The value that element 6 will be initialized to. + /// The value that element 7 will be initialized to. + /// The value that element 8 will be initialized to. + /// The value that element 9 will be initialized to. + /// The value that element 10 will be initialized to. + /// The value that element 11 will be initialized to. + /// The value that element 12 will be initialized to. + /// The value that element 13 will be initialized to. + /// The value that element 14 will be initialized to. + /// The value that element 15 will be initialized to. + /// A new with each element initialized to corresponding specified value. + /// On x86, this method corresponds to __m512i _mm512_setr_epi32 + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(int e0, int e1, int e2, int e3, int e4, int e5, int e6, int e7, int e8, int e9, int e10, int e11, int e12, int e13, int e14, int e15) + { + return Create( + Vector256.Create(e0, e1, e2, e3, e4, e5, e6, e7), + Vector256.Create(e8, e9, e10, e11, e12, e13, e14, e15) + ); + } + + /// Creates a new instance with each element initialized to the corresponding specified value. + /// The value that element 0 will be initialized to. + /// The value that element 1 will be initialized to. + /// The value that element 2 will be initialized to. + /// The value that element 3 will be initialized to. + /// The value that element 4 will be initialized to. + /// The value that element 5 will be initialized to. + /// The value that element 6 will be initialized to. + /// The value that element 7 will be initialized to. + /// A new with each element initialized to corresponding specified value. + /// On x86, this method corresponds to __m512i _mm512_setr_epi64x + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(long e0, long e1, long e2, long e3, long e4, long e5, long e6, long e7) + { + return Create( + Vector256.Create(e0, e1, e2, e3), + Vector256.Create(e4, e5, e6, e7) + ); + } + + /// Creates a new instance with each element initialized to the corresponding specified value. + /// The value that element 0 will be initialized to. + /// The value that element 1 will be initialized to. + /// The value that element 2 will be initialized to. + /// The value that element 3 will be initialized to. + /// The value that element 4 will be initialized to. + /// The value that element 5 will be initialized to. + /// The value that element 6 will be initialized to. + /// The value that element 7 will be initialized to. + /// The value that element 8 will be initialized to. + /// The value that element 9 will be initialized to. + /// The value that element 10 will be initialized to. + /// The value that element 11 will be initialized to. + /// The value that element 12 will be initialized to. + /// The value that element 13 will be initialized to. + /// The value that element 14 will be initialized to. + /// The value that element 15 will be initialized to. + /// The value that element 16 will be initialized to. + /// The value that element 17 will be initialized to. + /// The value that element 18 will be initialized to. + /// The value that element 19 will be initialized to. + /// The value that element 20 will be initialized to. + /// The value that element 21 will be initialized to. + /// The value that element 22 will be initialized to. + /// The value that element 23 will be initialized to. + /// The value that element 24 will be initialized to. + /// The value that element 25 will be initialized to. + /// The value that element 26 will be initialized to. + /// The value that element 27 will be initialized to. + /// The value that element 28 will be initialized to. + /// The value that element 29 will be initialized to. + /// The value that element 30 will be initialized to. + /// The value that element 31 will be initialized to. + /// The value that element 32 will be initialized to. + /// The value that element 33 will be initialized to. + /// The value that element 34 will be initialized to. + /// The value that element 35 will be initialized to. + /// The value that element 36 will be initialized to. + /// The value that element 37 will be initialized to. + /// The value that element 38 will be initialized to. + /// The value that element 39 will be initialized to. + /// The value that element 40 will be initialized to. + /// The value that element 41 will be initialized to. + /// The value that element 42 will be initialized to. + /// The value that element 43 will be initialized to. + /// The value that element 44 will be initialized to. + /// The value that element 45 will be initialized to. + /// The value that element 46 will be initialized to. + /// The value that element 47 will be initialized to. + /// The value that element 48 will be initialized to. + /// The value that element 49 will be initialized to. + /// The value that element 50 will be initialized to. + /// The value that element 51 will be initialized to. + /// The value that element 52 will be initialized to. + /// The value that element 53 will be initialized to. + /// The value that element 54 will be initialized to. + /// The value that element 55 will be initialized to. + /// The value that element 56 will be initialized to. + /// The value that element 57 will be initialized to. + /// The value that element 58 will be initialized to. + /// The value that element 59 will be initialized to. + /// The value that element 60 will be initialized to. + /// The value that element 61 will be initialized to. + /// The value that element 62 will be initialized to. + /// The value that element 63 will be initialized to. + /// A new with each element initialized to corresponding specified value. + /// On x86, this method corresponds to __m512i _mm512_setr_epi8 + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(sbyte e0, sbyte e1, sbyte e2, sbyte e3, sbyte e4, sbyte e5, sbyte e6, sbyte e7, sbyte e8, sbyte e9, sbyte e10, sbyte e11, sbyte e12, sbyte e13, sbyte e14, sbyte e15, + sbyte e16, sbyte e17, sbyte e18, sbyte e19, sbyte e20, sbyte e21, sbyte e22, sbyte e23, sbyte e24, sbyte e25, sbyte e26, sbyte e27, sbyte e28, sbyte e29, sbyte e30, sbyte e31, + sbyte e32, sbyte e33, sbyte e34, sbyte e35, sbyte e36, sbyte e37, sbyte e38, sbyte e39, sbyte e40, sbyte e41, sbyte e42, sbyte e43, sbyte e44, sbyte e45, sbyte e46, sbyte e47, + sbyte e48, sbyte e49, sbyte e50, sbyte e51, sbyte e52, sbyte e53, sbyte e54, sbyte e55, sbyte e56, sbyte e57, sbyte e58, sbyte e59, sbyte e60, sbyte e61, sbyte e62, sbyte e63) + { + return Create( + Vector256.Create(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31), + Vector256.Create(e32, e33, e34, e35, e36, e37, e38, e39, e40, e41, e42, e43, e44, e45, e46, e47, e48, e49, e50, e51, e52, e53, e54, e55, e56, e57, e58, e59, e60, e61, e62, e63) + ); + } + + /// Creates a new instance with each element initialized to the corresponding specified value. + /// The value that element 0 will be initialized to. + /// The value that element 1 will be initialized to. + /// The value that element 2 will be initialized to. + /// The value that element 3 will be initialized to. + /// The value that element 4 will be initialized to. + /// The value that element 5 will be initialized to. + /// The value that element 6 will be initialized to. + /// The value that element 7 will be initialized to. + /// The value that element 8 will be initialized to. + /// The value that element 9 will be initialized to. + /// The value that element 10 will be initialized to. + /// The value that element 11 will be initialized to. + /// The value that element 12 will be initialized to. + /// The value that element 13 will be initialized to. + /// The value that element 14 will be initialized to. + /// The value that element 15 will be initialized to. + /// A new with each element initialized to corresponding specified value. + /// On x86, this method corresponds to __m512 _mm512_setr_ps + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(float e0, float e1, float e2, float e3, float e4, float e5, float e6, float e7, float e8, float e9, float e10, float e11, float e12, float e13, float e14, float e15) + { + return Create( + Vector256.Create(e0, e1, e2, e3, e4, e5, e6, e7), + Vector256.Create(e8, e9, e10, e11, e12, e13, e14, e15) + ); + } + + /// Creates a new instance with each element initialized to the corresponding specified value. + /// The value that element 0 will be initialized to. + /// The value that element 1 will be initialized to. + /// The value that element 2 will be initialized to. + /// The value that element 3 will be initialized to. + /// The value that element 4 will be initialized to. + /// The value that element 5 will be initialized to. + /// The value that element 6 will be initialized to. + /// The value that element 7 will be initialized to. + /// The value that element 8 will be initialized to. + /// The value that element 9 will be initialized to. + /// The value that element 10 will be initialized to. + /// The value that element 11 will be initialized to. + /// The value that element 12 will be initialized to. + /// The value that element 13 will be initialized to. + /// The value that element 14 will be initialized to. + /// The value that element 15 will be initialized to. + /// The value that element 16 will be initialized to. + /// The value that element 17 will be initialized to. + /// The value that element 18 will be initialized to. + /// The value that element 19 will be initialized to. + /// The value that element 20 will be initialized to. + /// The value that element 21 will be initialized to. + /// The value that element 22 will be initialized to. + /// The value that element 23 will be initialized to. + /// The value that element 24 will be initialized to. + /// The value that element 25 will be initialized to. + /// The value that element 26 will be initialized to. + /// The value that element 27 will be initialized to. + /// The value that element 28 will be initialized to. + /// The value that element 29 will be initialized to. + /// The value that element 30 will be initialized to. + /// The value that element 31 will be initialized to. + /// A new with each element initialized to corresponding specified value. + /// On x86, this method corresponds to __m512i _mm512_setr_epi16 + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(ushort e0, ushort e1, ushort e2, ushort e3, ushort e4, ushort e5, ushort e6, ushort e7, ushort e8, ushort e9, ushort e10, ushort e11, ushort e12, ushort e13, ushort e14, ushort e15, + ushort e16, ushort e17, ushort e18, ushort e19, ushort e20, ushort e21, ushort e22, ushort e23, ushort e24, ushort e25, ushort e26, ushort e27, ushort e28, ushort e29, ushort e30, ushort e31) + { + return Create( + Vector256.Create(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15), + Vector256.Create(e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31) + ); + } + + /// Creates a new instance with each element initialized to the corresponding specified value. + /// The value that element 0 will be initialized to. + /// The value that element 1 will be initialized to. + /// The value that element 2 will be initialized to. + /// The value that element 3 will be initialized to. + /// The value that element 4 will be initialized to. + /// The value that element 5 will be initialized to. + /// The value that element 6 will be initialized to. + /// The value that element 7 will be initialized to. + /// The value that element 8 will be initialized to. + /// The value that element 9 will be initialized to. + /// The value that element 10 will be initialized to. + /// The value that element 11 will be initialized to. + /// The value that element 12 will be initialized to. + /// The value that element 13 will be initialized to. + /// The value that element 14 will be initialized to. + /// The value that element 15 will be initialized to. + /// A new with each element initialized to corresponding specified value. + /// On x86, this method corresponds to __m512i _mm512_setr_epi32 + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(uint e0, uint e1, uint e2, uint e3, uint e4, uint e5, uint e6, uint e7, uint e8, uint e9, uint e10, uint e11, uint e12, uint e13, uint e14, uint e15) + { + return Create( + Vector256.Create(e0, e1, e2, e3, e4, e5, e6, e7), + Vector256.Create(e8, e9, e10, e11, e12, e13, e14, e15) + ); + } + + /// Creates a new instance with each element initialized to the corresponding specified value. + /// The value that element 0 will be initialized to. + /// The value that element 1 will be initialized to. + /// The value that element 2 will be initialized to. + /// The value that element 3 will be initialized to. + /// The value that element 4 will be initialized to. + /// The value that element 5 will be initialized to. + /// The value that element 6 will be initialized to. + /// The value that element 7 will be initialized to. + /// A new with each element initialized to corresponding specified value. + /// On x86, this method corresponds to __m512i _mm512_setr_epi64x + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(ulong e0, ulong e1, ulong e2, ulong e3, ulong e4, ulong e5, ulong e6, ulong e7) + { + return Create( + Vector256.Create(e0, e1, e2, e3), + Vector256.Create(e4, e5, e6, e7) + ); + } + + /// Creates a new instance from two instances. + /// The type of the elements in the vector. + /// The value that the lower 256-bits will be initialized to. + /// The value that the upper 256-bits will be initialized to. + /// A new initialized from and . + /// The type of and () is not supported. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector512 Create(Vector256 lower, Vector256 upper) + where T : struct + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + Unsafe.SkipInit(out Vector512 result); + + result.SetLowerUnsafe(lower); + result.SetUpperUnsafe(upper); + + return result; + } + + /// Creates a new instance from two instances. + /// The value that the lower 256-bits will be initialized to. + /// The value that the upper 256-bits will be initialized to. + /// A new initialized from and . + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); + + /// Creates a new instance from two instances. + /// The value that the lower 256-bits will be initialized to. + /// The value that the upper 256-bits will be initialized to. + /// A new initialized from and . + /// On x86, this method corresponds to __m512d _mm512_setr_m256d (__m256d lo, __m256d hi) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); + + /// Creates a new instance from two instances. + /// The value that the lower 256-bits will be initialized to. + /// The value that the upper 256-bits will be initialized to. + /// A new initialized from and . + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); + + /// Creates a new instance from two instances. + /// The value that the lower 256-bits will be initialized to. + /// The value that the upper 256-bits will be initialized to. + /// A new initialized from and . + /// On x86, this method corresponds to __m512i _mm512_setr_m256i (__m256i lo, __m256i hi) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); + + /// Creates a new instance from two instances. + /// The value that the lower 256-bits will be initialized to. + /// The value that the upper 256-bits will be initialized to. + /// A new initialized from and . + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); + + /// Creates a new instance from two instances. + /// The value that the lower 256-bits will be initialized to. + /// The value that the upper 256-bits will be initialized to. + /// A new initialized from and . + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); + + /// Creates a new instance from two instances. + /// The value that the lower 256-bits will be initialized to. + /// The value that the upper 256-bits will be initialized to. + /// A new initialized from and . + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); + + /// Creates a new instance from two instances. + /// The value that the lower 256-bits will be initialized to. + /// The value that the upper 256-bits will be initialized to. + /// A new initialized from and . + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); + + /// Creates a new instance from two instances. + /// The value that the lower 256-bits will be initialized to. + /// The value that the upper 256-bits will be initialized to. + /// A new initialized from and . + /// On x86, this method corresponds to __m512 _mm512_setr_m256 (__m256 lo, __m256 hi) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); + + /// Creates a new instance from two instances. + /// The value that the lower 256-bits will be initialized to. + /// The value that the upper 256-bits will be initialized to. + /// A new initialized from and . + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); + + /// Creates a new instance from two instances. + /// The value that the lower 256-bits will be initialized to. + /// The value that the upper 256-bits will be initialized to. + /// A new initialized from and . + /// On x86, this method corresponds to __m512i _mm512_setr_m256i (__m256i lo, __m256i hi) + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); + + /// Creates a new instance from two instances. + /// The value that the lower 256-bits will be initialized to. + /// The value that the upper 256-bits will be initialized to. + /// A new initialized from and . + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. + /// The type of the elements in the vector. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements initialized to zero. + /// The type of () is not supported. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector512 CreateScalar(T value) + where T : struct => Vector256.CreateScalar(value).ToVector512(); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements initialized to zero. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalar(byte value) => CreateScalar(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements initialized to zero. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalar(double value) => CreateScalar(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements initialized to zero. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalar(short value) => CreateScalar(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements initialized to zero. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalar(int value) => CreateScalar(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements initialized to zero. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalar(long value) => CreateScalar(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements initialized to zero. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalar(nint value) => CreateScalar(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements initialized to zero. + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalar(nuint value) => CreateScalar(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements initialized to zero. + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalar(sbyte value) => CreateScalar(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements initialized to zero. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalar(float value) => CreateScalar(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements initialized to zero. + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalar(ushort value) => CreateScalar(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements initialized to zero. + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalar(uint value) => CreateScalar(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements initialized to zero. + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalar(ulong value) => CreateScalar(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. + /// The type of the elements in the vector. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements left uninitialized. + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector512 CreateScalarUnsafe(T value) + where T : struct + { + // This relies on us stripping the "init" flag from the ".locals" + // declaration to let the upper bits be uninitialized. + + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + Unsafe.SkipInit(out Vector512 result); + + result.SetElementUnsafe(0, value); + return result; + } + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements left uninitialized. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalarUnsafe(byte value) => CreateScalarUnsafe(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements left uninitialized. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalarUnsafe(double value) => CreateScalarUnsafe(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements left uninitialized. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalarUnsafe(short value) => CreateScalarUnsafe(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements left uninitialized. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalarUnsafe(int value) => CreateScalarUnsafe(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements left uninitialized. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalarUnsafe(long value) => CreateScalarUnsafe(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements left uninitialized. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalarUnsafe(nint value) => CreateScalarUnsafe(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements left uninitialized. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalarUnsafe(nuint value) => CreateScalarUnsafe(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements left uninitialized. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalarUnsafe(sbyte value) => CreateScalarUnsafe(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements left uninitialized. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalarUnsafe(float value) => CreateScalarUnsafe(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements left uninitialized. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalarUnsafe(ushort value) => CreateScalarUnsafe(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements left uninitialized. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalarUnsafe(uint value) => CreateScalarUnsafe(value); + + /// Creates a new instance with the first element initialized to the specified value and the remaining elements left uninitialized. + /// The value that element 0 will be initialized to. + /// A new instance with the first element initialized to and the remaining elements left uninitialized. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 CreateScalarUnsafe(ulong value) => CreateScalarUnsafe(value); + + /// Divides two vectors to compute their quotient. + /// The type of the elements in the vector. + /// The vector that will be divided by . + /// The vector that will divide . + /// The quotient of divided by . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Divide(Vector512 left, Vector512 right) + where T : struct + { + return Create( + Vector256.Divide(left._lower, right._lower), + Vector256.Divide(left._upper, right._upper) + ); + } + + /// Computes the dot product of two vectors. + /// The type of the elements in the vector. + /// The vector that will be dotted with . + /// The vector that will be dotted with . + /// The dot product of and . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T Dot(Vector512 left, Vector512 right) + where T : struct + { + // Doing this as Dot(lower) + Dot(upper) is important for floating-point determinism + // This is because the underlying dpps instruction on x86/x64 will do this equivalently + // and otherwise the software vs accelerated implementations may differ in returned result. + + T result = Vector256.Dot(left._lower, right._lower); + result = Scalar.Add(result, Vector256.Dot(left._upper, right._upper)); + return result; + } + + /// Compares two vectors to determine if they are equal on a per-element basis. + /// The type of the elements in the vector. + /// The vector to compare with . + /// The vector to compare with . + /// A vector whose elements are all-bits-set or zero, depending on if the corresponding elements in and were equal. + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Equals(Vector512 left, Vector512 right) + where T : struct + { + return Create( + Vector256.Equals(left._lower, right._lower), + Vector256.Equals(left._upper, right._upper) + ); + } + + /// Compares two vectors to determine if all elements are equal. + /// The vector to compare with . + /// The vector to compare with . + /// The type of the elements in the vector. + /// true if all elements in were equal to the corresponding element in . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool EqualsAll(Vector512 left, Vector512 right) + where T : struct => left == right; + + /// Compares two vectors to determine if any elements are equal. + /// The vector to compare with . + /// The vector to compare with . + /// The type of the elements in the vector. + /// true if any elements in was equal to the corresponding element in . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool EqualsAny(Vector512 left, Vector512 right) + where T : struct + { + return Vector256.EqualsAny(left._lower, right._lower) + || Vector256.EqualsAny(left._upper, right._upper); + } + + /// Extracts the most significant bit from each element in a vector. + /// The vector whose elements should have their most significant bit extracted. + /// The type of the elements in the vector. + /// The packed most significant bits extracted from the elements in . + /// The type of () is not supported. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong ExtractMostSignificantBits(this Vector512 vector) + where T : struct + { + ulong result = vector._lower.ExtractMostSignificantBits(); + result |= (ulong)(vector._upper.ExtractMostSignificantBits()) << Vector256.Count; + return result; + } + + /// Computes the floor of each element in a vector. + /// The vector that will have its floor computed. + /// A vector whose elements are the floor of the elements in . + /// + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Floor(Vector512 vector) + { + return Create( + Vector256.Floor(vector._lower), + Vector256.Floor(vector._upper) + ); + } + + /// Computes the floor of each element in a vector. + /// The vector that will have its floor computed. + /// A vector whose elements are the floor of the elements in . + /// + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Floor(Vector512 vector) + { + return Create( + Vector256.Floor(vector._lower), + Vector256.Floor(vector._upper) + ); + } + + /// Gets the element at the specified index. + /// The type of the input vector. + /// The vector to get the element from. + /// The index of the element to get. + /// The value of the element at . + /// was less than zero or greater than the number of elements. + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T GetElement(this Vector512 vector, int index) + where T : struct + { + if ((uint)(index) >= (uint)(Vector512.Count)) + { + ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.index); + } + + return vector.GetElementUnsafe(index); + } + + /// Gets the value of the lower 256-bits as a new . + /// The type of the input vector. + /// The vector to get the lower 256-bits from. + /// The value of the lower 256-bits as a new . + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector256 GetLower(this Vector512 vector) + where T : struct + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + return vector._lower; + } + + /// Gets the value of the upper 256-bits as a new . + /// The type of the input vector. + /// The vector to get the upper 256-bits from. + /// The value of the upper 256-bits as a new . + /// The type of () is not supported. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector256 GetUpper(this Vector512 vector) + where T : struct + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + return vector._upper; + } + + /// Compares two vectors to determine which is greater on a per-element basis. + /// The type of the elements in the vector. + /// The vector to compare with . + /// The vector to compare with . + /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were greater. + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 GreaterThan(Vector512 left, Vector512 right) + where T : struct + { + return Create( + Vector256.GreaterThan(left._lower, right._lower), + Vector256.GreaterThan(left._upper, right._upper) + ); + } + + /// Compares two vectors to determine if all elements are greater. + /// The type of the elements in the vector. + /// The vector to compare with . + /// The vector to compare with . + /// true if all elements in were greater than the corresponding element in . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool GreaterThanAll(Vector512 left, Vector512 right) + where T : struct + { + return Vector256.GreaterThanAll(left._lower, right._lower) + && Vector256.GreaterThanAll(left._upper, right._upper); + } + + /// Compares two vectors to determine if any elements are greater. + /// The type of the elements in the vector. + /// The vector to compare with . + /// The vector to compare with . + /// true if any elements in was greater than the corresponding element in . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool GreaterThanAny(Vector512 left, Vector512 right) + where T : struct + { + return Vector256.GreaterThanAny(left._lower, right._lower) + || Vector256.GreaterThanAny(left._upper, right._upper); + } + + /// Compares two vectors to determine which is greater or equal on a per-element basis. + /// The type of the elements in the vector. + /// The vector to compare with . + /// The vector to compare with . + /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were greater or equal. + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 GreaterThanOrEqual(Vector512 left, Vector512 right) + where T : struct + { + return Create( + Vector256.GreaterThanOrEqual(left._lower, right._lower), + Vector256.GreaterThanOrEqual(left._upper, right._upper) + ); + } + + /// Compares two vectors to determine if all elements are greater or equal. + /// The type of the elements in the vector. + /// The vector to compare with . + /// The vector to compare with . + /// true if all elements in were greater than or equal to the corresponding element in . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool GreaterThanOrEqualAll(Vector512 left, Vector512 right) + where T : struct + { + return Vector256.GreaterThanOrEqualAll(left._lower, right._lower) + && Vector256.GreaterThanOrEqualAll(left._upper, right._upper); + } + + /// Compares two vectors to determine if any elements are greater or equal. + /// The type of the elements in the vector. + /// The vector to compare with . + /// The vector to compare with . + /// true if any elements in was greater than or equal to the corresponding element in . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool GreaterThanOrEqualAny(Vector512 left, Vector512 right) + where T : struct + { + return Vector256.GreaterThanOrEqualAny(left._lower, right._lower) + || Vector256.GreaterThanOrEqualAny(left._upper, right._upper); + } + + /// Compares two vectors to determine which is less on a per-element basis. + /// The type of the elements in the vector. + /// The vector to compare with . + /// The vector to compare with . + /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were less. + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 LessThan(Vector512 left, Vector512 right) + where T : struct + { + return Create( + Vector256.LessThan(left._lower, right._lower), + Vector256.LessThan(left._upper, right._upper) + ); + } + + /// Compares two vectors to determine if all elements are less. + /// The type of the elements in the vector. + /// The vector to compare with . + /// The vector to compare with . + /// true if all elements in were less than the corresponding element in . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool LessThanAll(Vector512 left, Vector512 right) + where T : struct + { + return Vector256.LessThanAll(left._lower, right._lower) + && Vector256.LessThanAll(left._upper, right._upper); + } + + /// Compares two vectors to determine if any elements are less. + /// The type of the elements in the vector. + /// The vector to compare with . + /// The vector to compare with . + /// true if any elements in was less than the corresponding element in . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool LessThanAny(Vector512 left, Vector512 right) + where T : struct + { + return Vector256.LessThanAny(left._lower, right._lower) + || Vector256.LessThanAny(left._upper, right._upper); + } + + /// Compares two vectors to determine which is less or equal on a per-element basis. + /// The type of the elements in the vector. + /// The vector to compare with . + /// The vector to compare with . + /// A vector whose elements are all-bits-set or zero, depending on if which of the corresponding elements in and were less or equal. + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 LessThanOrEqual(Vector512 left, Vector512 right) + where T : struct + { + return Create( + Vector256.LessThanOrEqual(left._lower, right._lower), + Vector256.LessThanOrEqual(left._upper, right._upper) + ); + } + + /// Compares two vectors to determine if all elements are less or equal. + /// The type of the elements in the vector. + /// The vector to compare with . + /// The vector to compare with . + /// true if all elements in were less than or equal to the corresponding element in . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool LessThanOrEqualAll(Vector512 left, Vector512 right) + where T : struct + { + return Vector256.LessThanOrEqualAll(left._lower, right._lower) + && Vector256.LessThanOrEqualAll(left._upper, right._upper); + } + + /// Compares two vectors to determine if any elements are less or equal. + /// The type of the elements in the vector. + /// The vector to compare with . + /// The vector to compare with . + /// true if any elements in was less than or equal to the corresponding element in . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool LessThanOrEqualAny(Vector512 left, Vector512 right) + where T : struct + { + return Vector256.LessThanOrEqualAny(left._lower, right._lower) + || Vector256.LessThanOrEqualAny(left._upper, right._upper); + } + + /// Loads a vector from the given source. + /// The type of the elements in the vector. + /// The source from which the vector will be loaded. + /// The vector loaded from . + /// The type of () is not supported. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Load(T* source) + where T : unmanaged => LoadUnsafe(ref *source); + + /// Loads a vector from the given aligned source. + /// The type of the elements in the vector. + /// The aligned source from which the vector will be loaded. + /// The vector loaded from . + /// The type of () is not supported. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 LoadAligned(T* source) + where T : unmanaged + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + + if (((nuint)(source) % Alignment) != 0) + { + ThrowHelper.ThrowAccessViolationException(); + } + + return *(Vector512*)(source); + } + + /// Loads a vector from the given aligned source. + /// The type of the elements in the vector. + /// The aligned source from which the vector will be loaded. + /// The vector loaded from . + /// The type of () is not supported. + /// This method may bypass the cache on certain platforms. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 LoadAlignedNonTemporal(T* source) + where T : unmanaged => LoadAligned(source); + + /// Loads a vector from the given source. + /// The type of the elements in the vector. + /// The source from which the vector will be loaded. + /// The vector loaded from . + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 LoadUnsafe(ref T source) + where T : struct + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + ref byte address = ref Unsafe.As(ref source); + return Unsafe.ReadUnaligned>(ref address); + } + + /// Loads a vector from the given source and element offset. + /// The type of the elements in the vector. + /// The source to which will be added before loading the vector. + /// The element offset from from which the vector will be loaded. + /// The vector loaded from plus . + /// The type of () is not supported. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 LoadUnsafe(ref T source, nuint elementOffset) + where T : struct + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + source = ref Unsafe.Add(ref source, (nint)elementOffset); + return Unsafe.ReadUnaligned>(ref Unsafe.As(ref source)); + } + + /// Computes the maximum of two vectors on a per-element basis. + /// The type of the elements in the vector. + /// The vector to compare with . + /// The vector to compare with . + /// A vector whose elements are the maximum of the corresponding elements in and . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Max(Vector512 left, Vector512 right) + where T : struct + { + return Create( + Vector256.Max(left._lower, right._lower), + Vector256.Max(left._upper, right._upper) + ); + } + + /// Computes the minimum of two vectors on a per-element basis. + /// The type of the elements in the vector. + /// The vector to compare with . + /// The vector to compare with . + /// A vector whose elements are the minimum of the corresponding elements in and . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Min(Vector512 left, Vector512 right) + where T : struct + { + return Create( + Vector256.Min(left._lower, right._lower), + Vector256.Min(left._upper, right._upper) + ); + } + + /// Multiplies two vectors to compute their element-wise product. + /// The type of the elements in the vector. + /// The vector to multiply with . + /// The vector to multiply with . + /// The element-wise product of and . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Multiply(Vector512 left, Vector512 right) + where T : struct => left * right; + + /// Multiplies a vector by a scalar to compute their product. + /// The type of the elements in the vector. + /// The vector to multiply with . + /// The scalar to multiply with . + /// The product of and . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Multiply(Vector512 left, T right) + where T : struct => left * right; + + /// Multiplies a vector by a scalar to compute their product. + /// The type of the elements in the vector. + /// The scalar to multiply with . + /// The vector to multiply with . + /// The product of and . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Multiply(T left, Vector512 right) + where T : struct => left * right; + + /// Narrows two instances into one . + /// The vector that will be narrowed to the lower half of the result vector. + /// The vector that will be narrowed to the upper half of the result vector. + /// A containing elements narrowed from and . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Narrow(Vector512 lower, Vector512 upper) + { + return Create( + Vector256.Narrow(lower._lower, lower._upper), + Vector256.Narrow(upper._lower, upper._upper) + ); + } + + /// Narrows two instances into one . + /// The vector that will be narrowed to the lower half of the result vector. + /// The vector that will be narrowed to the upper half of the result vector. + /// A containing elements narrowed from and . + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Narrow(Vector512 lower, Vector512 upper) + { + return Create( + Vector256.Narrow(lower._lower, lower._upper), + Vector256.Narrow(upper._lower, upper._upper) + ); + } + + /// Narrows two instances into one . + /// The vector that will be narrowed to the lower half of the result vector. + /// The vector that will be narrowed to the upper half of the result vector. + /// A containing elements narrowed from and . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Narrow(Vector512 lower, Vector512 upper) + { + return Create( + Vector256.Narrow(lower._lower, lower._upper), + Vector256.Narrow(upper._lower, upper._upper) + ); + } + + /// Narrows two instances into one . + /// The vector that will be narrowed to the lower half of the result vector. + /// The vector that will be narrowed to the upper half of the result vector. + /// A containing elements narrowed from and . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Narrow(Vector512 lower, Vector512 upper) + { + return Create( + Vector256.Narrow(lower._lower, lower._upper), + Vector256.Narrow(upper._lower, upper._upper) + ); + } + + /// Narrows two instances into one . + /// The vector that will be narrowed to the lower half of the result vector. + /// The vector that will be narrowed to the upper half of the result vector. + /// A containing elements narrowed from and . + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Narrow(Vector512 lower, Vector512 upper) + { + return Create( + Vector256.Narrow(lower._lower, lower._upper), + Vector256.Narrow(upper._lower, upper._upper) + ); + } + + /// Narrows two instances into one . + /// The vector that will be narrowed to the lower half of the result vector. + /// The vector that will be narrowed to the upper half of the result vector. + /// A containing elements narrowed from and . + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Narrow(Vector512 lower, Vector512 upper) + { + return Create( + Vector256.Narrow(lower._lower, lower._upper), + Vector256.Narrow(upper._lower, upper._upper) + ); + } + + /// Narrows two instances into one . + /// The vector that will be narrowed to the lower half of the result vector. + /// The vector that will be narrowed to the upper half of the result vector. + /// A containing elements narrowed from and . + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Narrow(Vector512 lower, Vector512 upper) + { + return Create( + Vector256.Narrow(lower._lower, lower._upper), + Vector256.Narrow(upper._lower, upper._upper) + ); + } + + /// Negates a vector. + /// The type of the elements in the vector. + /// The vector to negate. + /// A vector whose elements are the negation of the corresponding elements in . + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Negate(Vector512 vector) + where T : struct => -vector; + + /// Computes the ones-complement of a vector. + /// The type of the elements in the vector. + /// The vector whose ones-complement is to be computed. + /// A vector whose elements are the ones-complement of the corresponding elements in . + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 OnesComplement(Vector512 vector) + where T : struct + { + return Create( + Vector256.OnesComplement(vector._lower), + Vector256.OnesComplement(vector._upper) + ); + } + + /// Shifts each element of a vector left by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted left by . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftLeft(vector._lower, shiftCount), + Vector256.ShiftLeft(vector._upper, shiftCount) + ); + } + + /// Shifts each element of a vector left by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted left by . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftLeft(vector._lower, shiftCount), + Vector256.ShiftLeft(vector._upper, shiftCount) + ); + } + + /// Shifts each element of a vector left by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted left by . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftLeft(vector._lower, shiftCount), + Vector256.ShiftLeft(vector._upper, shiftCount) + ); + } + + /// Shifts each element of a vector left by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted left by . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftLeft(vector._lower, shiftCount), + Vector256.ShiftLeft(vector._upper, shiftCount) + ); + } + + /// Shifts each element of a vector left by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted left by . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftLeft(vector._lower, shiftCount), + Vector256.ShiftLeft(vector._upper, shiftCount) + ); + } + + /// Shifts each element of a vector left by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted left by . + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftLeft(vector._lower, shiftCount), + Vector256.ShiftLeft(vector._upper, shiftCount) + ); + } + + /// Shifts each element of a vector left by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted left by . + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftLeft(vector._lower, shiftCount), + Vector256.ShiftLeft(vector._upper, shiftCount) + ); + } + + /// Shifts each element of a vector left by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted left by . + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftLeft(vector._lower, shiftCount), + Vector256.ShiftLeft(vector._upper, shiftCount) + ); + } + + /// Shifts each element of a vector left by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted left by . + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftLeft(vector._lower, shiftCount), + Vector256.ShiftLeft(vector._upper, shiftCount) + ); + } + + /// Shifts each element of a vector left by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted left by . + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftLeft(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftLeft(vector._lower, shiftCount), + Vector256.ShiftLeft(vector._upper, shiftCount) + ); + } + + /// Shifts (signed) each element of a vector right by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted right by . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftRightArithmetic(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftRightArithmetic(vector._lower, shiftCount), + Vector256.ShiftRightArithmetic(vector._upper, shiftCount) + ); + } + + /// Shifts (signed) each element of a vector right by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted right by . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftRightArithmetic(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftRightArithmetic(vector._lower, shiftCount), + Vector256.ShiftRightArithmetic(vector._upper, shiftCount) + ); + } + + /// Shifts (signed) each element of a vector right by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted right by . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftRightArithmetic(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftRightArithmetic(vector._lower, shiftCount), + Vector256.ShiftRightArithmetic(vector._upper, shiftCount) + ); + } + + /// Shifts (signed) each element of a vector right by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted right by . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftRightArithmetic(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftRightArithmetic(vector._lower, shiftCount), + Vector256.ShiftRightArithmetic(vector._upper, shiftCount) + ); + } + + /// Shifts (signed) each element of a vector right by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted right by . + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftRightArithmetic(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftRightArithmetic(vector._lower, shiftCount), + Vector256.ShiftRightArithmetic(vector._upper, shiftCount) + ); + } + + /// Shifts (unsigned) each element of a vector right by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted right by . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftRightLogical(vector._lower, shiftCount), + Vector256.ShiftRightLogical(vector._upper, shiftCount) + ); + } + + /// Shifts (unsigned) each element of a vector right by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted right by . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftRightLogical(vector._lower, shiftCount), + Vector256.ShiftRightLogical(vector._upper, shiftCount) + ); + } + + /// Shifts (unsigned) each element of a vector right by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted right by . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftRightLogical(vector._lower, shiftCount), + Vector256.ShiftRightLogical(vector._upper, shiftCount) + ); + } + + /// Shifts (unsigned) each element of a vector right by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted right by . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftRightLogical(vector._lower, shiftCount), + Vector256.ShiftRightLogical(vector._upper, shiftCount) + ); + } + + /// Shifts (unsigned) each element of a vector right by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted right by . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftRightLogical(vector._lower, shiftCount), + Vector256.ShiftRightLogical(vector._upper, shiftCount) + ); + } + + /// Shifts (unsigned) each element of a vector right by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted right by . + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftRightLogical(vector._lower, shiftCount), + Vector256.ShiftRightLogical(vector._upper, shiftCount) + ); + } + + /// Shifts (unsigned) each element of a vector right by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted right by . + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftRightLogical(vector._lower, shiftCount), + Vector256.ShiftRightLogical(vector._upper, shiftCount) + ); + } + + /// Shifts (unsigned) each element of a vector right by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted right by . + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftRightLogical(vector._lower, shiftCount), + Vector256.ShiftRightLogical(vector._upper, shiftCount) + ); + } + + /// Shifts (unsigned) each element of a vector right by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted right by . + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftRightLogical(vector._lower, shiftCount), + Vector256.ShiftRightLogical(vector._upper, shiftCount) + ); + } + + /// Shifts (unsigned) each element of a vector right by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted right by . + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 ShiftRightLogical(Vector512 vector, int shiftCount) + { + return Create( + Vector256.ShiftRightLogical(vector._lower, shiftCount), + Vector256.ShiftRightLogical(vector._upper, shiftCount) + ); + } + + /// Creates a new vector by selecting values from an input vector using a set of indices. + /// The input vector from which values are selected. + /// The per-element indices used to select a value from . + /// A new vector containing the values from selected by the given . + [Intrinsic] + public static Vector512 Shuffle(Vector512 vector, Vector512 indices) + { + Unsafe.SkipInit(out Vector512 result); + + for (int index = 0; index < Vector512.Count; index++) + { + byte selectedIndex = indices.GetElementUnsafe(index); + byte selectedValue = 0; + + if (selectedIndex < Vector512.Count) + { + selectedValue = vector.GetElementUnsafe(selectedIndex); + } + result.SetElementUnsafe(index, selectedValue); + } + + return result; + } + + /// Creates a new vector by selecting values from an input vector using a set of indices. + /// The input vector from which values are selected. + /// The per-element indices used to select a value from . + /// A new vector containing the values from selected by the given . + [Intrinsic] + [CLSCompliant(false)] + public static Vector512 Shuffle(Vector512 vector, Vector512 indices) + { + Unsafe.SkipInit(out Vector512 result); + + for (int index = 0; index < Vector512.Count; index++) + { + byte selectedIndex = (byte)indices.GetElementUnsafe(index); + sbyte selectedValue = 0; + + if (selectedIndex < Vector512.Count) + { + selectedValue = vector.GetElementUnsafe(selectedIndex); + } + result.SetElementUnsafe(index, selectedValue); + } + + return result; + } + + /// Creates a new vector by selecting values from an input vector using a set of indices. + /// The input vector from which values are selected. + /// The per-element indices used to select a value from . + /// A new vector containing the values from selected by the given . + [Intrinsic] + public static Vector512 Shuffle(Vector512 vector, Vector512 indices) + { + Unsafe.SkipInit(out Vector512 result); + + for (int index = 0; index < Vector512.Count; index++) + { + ushort selectedIndex = (ushort)indices.GetElementUnsafe(index); + short selectedValue = 0; + + if (selectedIndex < Vector512.Count) + { + selectedValue = vector.GetElementUnsafe(selectedIndex); + } + result.SetElementUnsafe(index, selectedValue); + } + + return result; + } + + /// Creates a new vector by selecting values from an input vector using a set of indices. + /// The input vector from which values are selected. + /// The per-element indices used to select a value from . + /// A new vector containing the values from selected by the given . + [Intrinsic] + [CLSCompliant(false)] + public static Vector512 Shuffle(Vector512 vector, Vector512 indices) + { + Unsafe.SkipInit(out Vector512 result); + + for (int index = 0; index < Vector512.Count; index++) + { + ushort selectedIndex = indices.GetElementUnsafe(index); + ushort selectedValue = 0; + + if (selectedIndex < Vector512.Count) + { + selectedValue = vector.GetElementUnsafe(selectedIndex); + } + result.SetElementUnsafe(index, selectedValue); + } + + return result; + } + + /// Creates a new vector by selecting values from an input vector using a set of indices. + /// The input vector from which values are selected. + /// The per-element indices used to select a value from . + /// A new vector containing the values from selected by the given . + [Intrinsic] + public static Vector512 Shuffle(Vector512 vector, Vector512 indices) + { + Unsafe.SkipInit(out Vector512 result); + + for (int index = 0; index < Vector512.Count; index++) + { + uint selectedIndex = (uint)indices.GetElementUnsafe(index); + int selectedValue = 0; + + if (selectedIndex < Vector512.Count) + { + selectedValue = vector.GetElementUnsafe((int)selectedIndex); + } + result.SetElementUnsafe(index, selectedValue); + } + + return result; + } + + /// Creates a new vector by selecting values from an input vector using a set of indices. + /// The input vector from which values are selected. + /// The per-element indices used to select a value from . + /// A new vector containing the values from selected by the given . + [Intrinsic] + [CLSCompliant(false)] + public static Vector512 Shuffle(Vector512 vector, Vector512 indices) + { + Unsafe.SkipInit(out Vector512 result); + + for (int index = 0; index < Vector512.Count; index++) + { + uint selectedIndex = indices.GetElementUnsafe(index); + uint selectedValue = 0; + + if (selectedIndex < Vector512.Count) + { + selectedValue = vector.GetElementUnsafe((int)selectedIndex); + } + result.SetElementUnsafe(index, selectedValue); + } + + return result; + } + + /// Creates a new vector by selecting values from an input vector using a set of indices. + /// The input vector from which values are selected. + /// The per-element indices used to select a value from . + /// A new vector containing the values from selected by the given . + [Intrinsic] + public static Vector512 Shuffle(Vector512 vector, Vector512 indices) + { + Unsafe.SkipInit(out Vector512 result); + + for (int index = 0; index < Vector512.Count; index++) + { + uint selectedIndex = (uint)indices.GetElementUnsafe(index); + float selectedValue = 0; + + if (selectedIndex < Vector512.Count) + { + selectedValue = vector.GetElementUnsafe((int)selectedIndex); + } + result.SetElementUnsafe(index, selectedValue); + } + + return result; + } + + /// Creates a new vector by selecting values from an input vector using a set of indices. + /// The input vector from which values are selected. + /// The per-element indices used to select a value from . + /// A new vector containing the values from selected by the given . + [Intrinsic] + public static Vector512 Shuffle(Vector512 vector, Vector512 indices) + { + Unsafe.SkipInit(out Vector512 result); + + for (int index = 0; index < Vector512.Count; index++) + { + ulong selectedIndex = (ulong)indices.GetElementUnsafe(index); + long selectedValue = 0; + + if (selectedIndex < (uint)Vector512.Count) + { + selectedValue = vector.GetElementUnsafe((int)selectedIndex); + } + result.SetElementUnsafe(index, selectedValue); + } + + return result; + } + + /// Creates a new vector by selecting values from an input vector using a set of indices. + /// The input vector from which values are selected. + /// The per-element indices used to select a value from . + /// A new vector containing the values from selected by the given . + [Intrinsic] + [CLSCompliant(false)] + public static Vector512 Shuffle(Vector512 vector, Vector512 indices) + { + Unsafe.SkipInit(out Vector512 result); + + for (int index = 0; index < Vector512.Count; index++) + { + ulong selectedIndex = indices.GetElementUnsafe(index); + ulong selectedValue = 0; + + if (selectedIndex < (uint)Vector512.Count) + { + selectedValue = vector.GetElementUnsafe((int)selectedIndex); + } + result.SetElementUnsafe(index, selectedValue); + } + + return result; + } + + /// Creates a new vector by selecting values from an input vector using a set of indices. + /// The input vector from which values are selected. + /// The per-element indices used to select a value from . + /// A new vector containing the values from selected by the given . + [Intrinsic] + public static Vector512 Shuffle(Vector512 vector, Vector512 indices) + { + Unsafe.SkipInit(out Vector512 result); + + for (int index = 0; index < Vector512.Count; index++) + { + ulong selectedIndex = (ulong)indices.GetElementUnsafe(index); + double selectedValue = 0; + + if (selectedIndex < (uint)Vector512.Count) + { + selectedValue = vector.GetElementUnsafe((int)selectedIndex); + } + result.SetElementUnsafe(index, selectedValue); + } + + return result; + } + + /// Computes the square root of a vector on a per-element basis. + /// The type of the elements in the vector. + /// The vector whose square root is to be computed. + /// A vector whose elements are the square root of the corresponding elements in . + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Sqrt(Vector512 vector) + where T : struct + { + return Create( + Vector256.Sqrt(vector._lower), + Vector256.Sqrt(vector._upper) + ); + } + + /// Stores a vector at the given destination. + /// The type of the elements in the vector. + /// The vector that will be stored. + /// The destination at which will be stored. + /// The type of and () is not supported. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Store(this Vector512 source, T* destination) + where T : unmanaged => source.StoreUnsafe(ref *destination); + + /// Stores a vector at the given aligned destination. + /// The type of the elements in the vector. + /// The vector that will be stored. + /// The aligned destination at which will be stored. + /// The type of and () is not supported. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void StoreAligned(this Vector512 source, T* destination) + where T : unmanaged + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + + if (((nuint)(destination) % Alignment) != 0) + { + ThrowHelper.ThrowAccessViolationException(); + } + + *(Vector512*)(destination) = source; + } + + /// Stores a vector at the given aligned destination. + /// The type of the elements in the vector. + /// The vector that will be stored. + /// The aligned destination at which will be stored. + /// The type of and () is not supported. + /// This method may bypass the cache on certain platforms. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void StoreAlignedNonTemporal(this Vector512 source, T* destination) + where T : unmanaged => source.StoreAligned(destination); + + /// Stores a vector at the given destination. + /// The type of the elements in the vector. + /// The vector that will be stored. + /// The destination at which will be stored. + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void StoreUnsafe(this Vector512 source, ref T destination) + where T : struct + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + ref byte address = ref Unsafe.As(ref destination); + Unsafe.WriteUnaligned(ref address, source); + } + + /// Stores a vector at the given destination. + /// The type of the elements in the vector. + /// The vector that will be stored. + /// The destination to which will be added before the vector will be stored. + /// The element offset from from which the vector will be stored. + /// The type of and () is not supported. + [Intrinsic] + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void StoreUnsafe(this Vector512 source, ref T destination, nuint elementOffset) + where T : struct + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + destination = ref Unsafe.Add(ref destination, (nint)elementOffset); + Unsafe.WriteUnaligned(ref Unsafe.As(ref destination), source); + } + + /// Subtracts two vectors to compute their difference. + /// The vector from which will be subtracted. + /// The vector to subtract from . + /// The type of the elements in the vector. + /// The difference of and . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Subtract(Vector512 left, Vector512 right) + where T : struct => left - right; + + /// Computes the sum of all elements in a vector. + /// The vector whose elements will be summed. + /// The type of the elements in the vector. + /// The sum of all elements in . + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T Sum(Vector512 vector) + where T : struct + { + // Doing this as Sum(lower) + Sum(upper) is important for floating-point determinism + // This is because the underlying dpps instruction on x86/x64 will do this equivalently + // and otherwise the software vs accelerated implementations may differ in returned result. + + T result = Vector256.Sum(vector._lower); + result = Scalar.Add(result, Vector256.Sum(vector._upper)); + return result; + } + + /// Converts the given vector to a scalar containing the value of the first element. + /// The type of the input vector. + /// The vector to get the first element from. + /// A scalar containing the value of the first element. + /// The type of () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T ToScalar(this Vector512 vector) + where T : struct + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + return vector.GetElementUnsafe(0); + } + + /// Tries to copy a to a given span. + /// The type of the input vector. + /// The vector to copy. + /// The span to which is copied. + /// true if was successfully copied to ; otherwise, false if the length of is less than . + /// The type of and () is not supported. + public static bool TryCopyTo(this Vector512 vector, Span destination) + where T : struct + { + if ((uint)destination.Length < (uint)Vector512.Count) + { + return false; + } + + ref byte address = ref Unsafe.As(ref MemoryMarshal.GetReference(destination)); + Unsafe.WriteUnaligned(ref address, vector); + return true; + } + + /// Widens a into two . + /// The vector whose elements are to be widened. + /// A pair of vectors that contain the widened lower and upper halves of . + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static (Vector512 Lower, Vector512 Upper) Widen(Vector512 source) => (WidenLower(source), WidenUpper(source)); + + /// Widens a into two . + /// The vector whose elements are to be widened. + /// A pair of vectors that contain the widened lower and upper halves of . + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static (Vector512 Lower, Vector512 Upper) Widen(Vector512 source) => (WidenLower(source), WidenUpper(source)); + + /// Widens a into two . + /// The vector whose elements are to be widened. + /// A pair of vectors that contain the widened lower and upper halves of . + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static (Vector512 Lower, Vector512 Upper) Widen(Vector512 source) => (WidenLower(source), WidenUpper(source)); + + /// Widens a into two . + /// The vector whose elements are to be widened. + /// A pair of vectors that contain the widened lower and upper halves of . + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static (Vector512 Lower, Vector512 Upper) Widen(Vector512 source) => (WidenLower(source), WidenUpper(source)); + + /// Widens a into two . + /// The vector whose elements are to be widened. + /// A pair of vectors that contain the widened lower and upper halves of . + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static (Vector512 Lower, Vector512 Upper) Widen(Vector512 source) => (WidenLower(source), WidenUpper(source)); + + /// Widens a into two . + /// The vector whose elements are to be widened. + /// A pair of vectors that contain the widened lower and upper halves of . + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static (Vector512 Lower, Vector512 Upper) Widen(Vector512 source) => (WidenLower(source), WidenUpper(source)); + + /// Widens a into two . + /// The vector whose elements are to be widened. + /// A pair of vectors that contain the widened lower and upper halves of . + [CLSCompliant(false)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static (Vector512 Lower, Vector512 Upper) Widen(Vector512 source) => (WidenLower(source), WidenUpper(source)); + + /// Creates a new with the element at the specified index set to the specified value and the remaining elements set to the same value as that in the given vector. + /// The type of the input vector. + /// The vector to get the remaining elements from. + /// The index of the element to set. + /// The value to set the element to. + /// A with the value of the element at set to and the remaining elements set to the same value as that in . + /// was less than zero or greater than the number of elements. + /// The type of () is not supported. + [Intrinsic] + public static Vector512 WithElement(this Vector512 vector, int index, T value) + where T : struct + { + if ((uint)(index) >= (uint)(Vector512.Count)) + { + ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.index); + } + + Vector512 result = vector; + result.SetElementUnsafe(index, value); + return result; + } + + /// Creates a new with the lower 256-bits set to the specified value and the upper 256-bits set to the same value as that in the given vector. + /// The type of the input vector. + /// The vector to get the upper 256-bits from. + /// The value of the lower 256-bits as a . + /// A new with the lower 256-bits set to and the upper 256-bits set to the same value as that in . + /// The type of () is not supported. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 WithLower(this Vector512 vector, Vector256 value) + where T : struct + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + + Vector512 result = vector; + result.SetLowerUnsafe(value); + return result; + } + + /// Creates a new with the upper 256-bits set to the specified value and the upper 256-bits set to the same value as that in the given vector. + /// The type of the input vector. + /// The vector to get the lower 256-bits from. + /// The value of the upper 256-bits as a . + /// A new with the upper 256-bits set to and the lower 256-bits set to the same value as that in . + /// The type of () is not supported. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 WithUpper(this Vector512 vector, Vector256 value) + where T : struct + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + + Vector512 result = vector; + result.SetUpperUnsafe(value); + return result; + } + + /// Computes the exclusive-or of two vectors. + /// The type of the elements in the vector. + /// The vector to exclusive-or with . + /// The vector to exclusive-or with . + /// The exclusive-or of and . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Xor(Vector512 left, Vector512 right) + where T : struct => left ^ right; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static T GetElementUnsafe(in this Vector512 vector, int index) + where T : struct + { + Debug.Assert((index >= 0) && (index < Vector512.Count)); + ref T address = ref Unsafe.As, T>(ref Unsafe.AsRef(in vector)); + return Unsafe.Add(ref address, index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void SetElementUnsafe(in this Vector512 vector, int index, T value) + where T : struct + { + Debug.Assert((index >= 0) && (index < Vector512.Count)); + ref T address = ref Unsafe.As, T>(ref Unsafe.AsRef(in vector)); + Unsafe.Add(ref address, index) = value; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void SetLowerUnsafe(in this Vector512 vector, Vector256 value) + where T : struct + { + Unsafe.AsRef(in vector._lower) = value; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void SetUpperUnsafe(in this Vector512 vector, Vector256 value) + where T : struct + { + Unsafe.AsRef(in vector._upper) = value; + } + + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector512 WidenLower(Vector512 source) + { + Vector256 lower = source._lower; + + return Create( + Vector256.WidenLower(lower), + Vector256.WidenUpper(lower) + ); + } + + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector512 WidenLower(Vector512 source) + { + Vector256 lower = source._lower; + + return Create( + Vector256.WidenLower(lower), + Vector256.WidenUpper(lower) + ); + } + + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector512 WidenLower(Vector512 source) + { + Vector256 lower = source._lower; + + return Create( + Vector256.WidenLower(lower), + Vector256.WidenUpper(lower) + ); + } + + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector512 WidenLower(Vector512 source) + { + Vector256 lower = source._lower; + + return Create( + Vector256.WidenLower(lower), + Vector256.WidenUpper(lower) + ); + } + + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector512 WidenLower(Vector512 source) + { + Vector256 lower = source._lower; + + return Create( + Vector256.WidenLower(lower), + Vector256.WidenUpper(lower) + ); + } + + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector512 WidenLower(Vector512 source) + { + Vector256 lower = source._lower; + + return Create( + Vector256.WidenLower(lower), + Vector256.WidenUpper(lower) + ); + } + + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector512 WidenLower(Vector512 source) + { + Vector256 lower = source._lower; + + return Create( + Vector256.WidenLower(lower), + Vector256.WidenUpper(lower) + ); + } + + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector512 WidenUpper(Vector512 source) + { + Vector256 upper = source._upper; + + return Create( + Vector256.WidenLower(upper), + Vector256.WidenUpper(upper) + ); + } + + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector512 WidenUpper(Vector512 source) + { + Vector256 upper = source._upper; + + return Create( + Vector256.WidenLower(upper), + Vector256.WidenUpper(upper) + ); + } + + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector512 WidenUpper(Vector512 source) + { + Vector256 upper = source._upper; + + return Create( + Vector256.WidenLower(upper), + Vector256.WidenUpper(upper) + ); + } + + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector512 WidenUpper(Vector512 source) + { + Vector256 upper = source._upper; + + return Create( + Vector256.WidenLower(upper), + Vector256.WidenUpper(upper) + ); + } + + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector512 WidenUpper(Vector512 source) + { + Vector256 upper = source._upper; + + return Create( + Vector256.WidenLower(upper), + Vector256.WidenUpper(upper) + ); + } + + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector512 WidenUpper(Vector512 source) + { + Vector256 upper = source._upper; + + return Create( + Vector256.WidenLower(upper), + Vector256.WidenUpper(upper) + ); + } + + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static Vector512 WidenUpper(Vector512 source) + { + Vector256 upper = source._upper; + + return Create( + Vector256.WidenLower(upper), + Vector256.WidenUpper(upper) + ); + } + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512DebugView_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512DebugView_1.cs new file mode 100644 index 00000000000000..61e3cef69d88e8 --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512DebugView_1.cs @@ -0,0 +1,138 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +namespace System.Runtime.Intrinsics +{ + internal readonly struct Vector512DebugView + where T : struct + { + private readonly Vector512 _value; + + public Vector512DebugView(Vector512 value) + { + _value = value; + } + + public byte[] ByteView + { + get + { + var items = new byte[Vector512.Count]; + Unsafe.WriteUnaligned(ref items[0], _value); + return items; + } + } + + public double[] DoubleView + { + get + { + var items = new double[Vector512.Count]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value); + return items; + } + } + + public short[] Int16View + { + get + { + var items = new short[Vector512.Count]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value); + return items; + } + } + + public int[] Int32View + { + get + { + var items = new int[Vector512.Count]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value); + return items; + } + } + + public long[] Int64View + { + get + { + var items = new long[Vector512.Count]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value); + return items; + } + } + + public nint[] NIntView + { + get + { + var items = new nint[Vector512.Count]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value); + return items; + } + } + + public nuint[] NUIntView + { + get + { + var items = new nuint[Vector512.Count]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value); + return items; + } + } + + public sbyte[] SByteView + { + get + { + var items = new sbyte[Vector512.Count]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value); + return items; + } + } + + public float[] SingleView + { + get + { + var items = new float[Vector512.Count]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value); + return items; + } + } + + public ushort[] UInt16View + { + get + { + var items = new ushort[Vector512.Count]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value); + return items; + } + } + + public uint[] UInt32View + { + get + { + var items = new uint[Vector512.Count]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value); + return items; + } + } + + public ulong[] UInt64View + { + get + { + var items = new ulong[Vector512.Count]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value); + return items; + } + } + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs new file mode 100644 index 00000000000000..59dafd3292268a --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs @@ -0,0 +1,391 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.Globalization; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace System.Runtime.Intrinsics +{ + // We mark certain methods with AggressiveInlining to ensure that the JIT will + // inline them. The JIT would otherwise not inline the method since it, at the + // point it tries to determine inline profability, currently cannot determine + // that most of the code-paths will be optimized away as "dead code". + // + // We then manually inline cases (such as certain intrinsic code-paths) that + // will generate code small enough to make the AgressiveInlining profitable. The + // other cases (such as the software fallback) are placed in their own method. + // This ensures we get good codegen for the "fast-path" and allows the JIT to + // determine inline profitability of the other paths as it would normally. + + /// Represents a 512-bit vector of a specified numeric type that is suitable for low-level optimization of parallel algorithms. + /// The type of the elements in the vector. + [Intrinsic] + [DebuggerDisplay("{DisplayString,nq}")] + [DebuggerTypeProxy(typeof(Vector512DebugView<>))] + [StructLayout(LayoutKind.Sequential, Size = Vector512.Size)] + public readonly struct Vector512 : IEquatable> + where T : struct + { + internal readonly Vector256 _lower; + internal readonly Vector256 _upper; + + /// Gets a new with all bits set to 1. + /// The type of the vector () is not supported. + public static Vector512 AllBitsSet + { + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + Vector256 vector = Vector256.AllBitsSet; + return Vector512.Create(vector, vector); + } + } + + /// Gets the number of that are in a . + /// The type of the vector () is not supported. + public static int Count + { + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + return Vector256.Count * 2; + } + } + + /// Gets true if is supported; otherwise, false. + /// true if is supported; otherwise, false. + public static bool IsSupported + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + return (typeof(T) == typeof(byte)) + || (typeof(T) == typeof(double)) + || (typeof(T) == typeof(short)) + || (typeof(T) == typeof(int)) + || (typeof(T) == typeof(long)) + || (typeof(T) == typeof(nint)) + || (typeof(T) == typeof(sbyte)) + || (typeof(T) == typeof(float)) + || (typeof(T) == typeof(ushort)) + || (typeof(T) == typeof(uint)) + || (typeof(T) == typeof(ulong)) + || (typeof(T) == typeof(nuint)); + } + } + + /// Gets a new with all elements initialized to zero. + /// The type of the vector () is not supported. + public static Vector512 Zero + { + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + return default; + } + } + + internal string DisplayString + { + get + { + return IsSupported ? ToString() : SR.NotSupported_Type; + } + } + + /// Gets the element at the specified index. + /// The index of the element to get. + /// The value of the element at . + /// was less than zero or greater than the number of elements. + /// The type of the vector () is not supported. + public T this[int index] + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + return this.GetElement(index); + } + } + + /// Adds two vectors to compute their sum. + /// The vector to add with . + /// The vector to add with . + /// The sum of and . + /// The type of the vector () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 operator +(Vector512 left, Vector512 right) + { + return Vector512.Create( + left._lower + right._lower, + left._upper + right._upper + ); + } + + /// Computes the bitwise-and of two vectors. + /// The vector to bitwise-and with . + /// The vector to bitwise-and with . + /// The bitwise-and of and . + /// The type of the vector () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 operator &(Vector512 left, Vector512 right) + { + return Vector512.Create( + left._lower & right._lower, + left._upper & right._upper + ); + } + + /// Computes the bitwise-or of two vectors. + /// The vector to bitwise-or with . + /// The vector to bitwise-or with . + /// The bitwise-or of and . + /// The type of the vector () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 operator |(Vector512 left, Vector512 right) + { + return Vector512.Create( + left._lower | right._lower, + left._upper | right._upper + ); + } + + /// Divides two vectors to compute their quotient. + /// The vector that will be divided by . + /// The vector that will divide . + /// The quotient of divided by . + /// The type of the vector () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 operator /(Vector512 left, Vector512 right) + { + return Vector512.Create( + left._lower / right._lower, + left._upper / right._upper + ); + } + + /// Compares two vectors to determine if all elements are equal. + /// The vector to compare with . + /// The vector to compare with . + /// true if all elements in were equal to the corresponding element in . + /// The type of the vector () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Vector512 left, Vector512 right) + { + return (left._lower == right._lower) + && (left._upper == right._upper); + } + + /// Computes the exclusive-or of two vectors. + /// The vector to exclusive-or with . + /// The vector to exclusive-or with . + /// The exclusive-or of and . + /// The type of the vector () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 operator ^(Vector512 left, Vector512 right) + { + return Vector512.Create( + left._lower ^ right._lower, + left._upper ^ right._upper + ); + } + + /// Compares two vectors to determine if any elements are not equal. + /// The vector to compare with . + /// The vector to compare with . + /// true if any elements in was not equal to the corresponding element in . + /// The type of the vector () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Vector512 left, Vector512 right) + { + return (left._lower != right._lower) + || (left._upper != right._upper); + } + + /// Multiplies two vectors to compute their element-wise product. + /// The vector to multiply with . + /// The vector to multiply with . + /// The element-wise product of and . + /// The type of the vector () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 operator *(Vector512 left, Vector512 right) + { + return Vector512.Create( + left._lower * right._lower, + left._upper * right._upper + ); + } + + /// Multiplies a vector by a scalar to compute their product. + /// The vector to multiply with . + /// The scalar to multiply with . + /// The product of and . + /// The type of the vector () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 operator *(Vector512 left, T right) + { + return Vector512.Create( + left._lower * right, + left._upper * right + ); + } + + /// Multiplies a vector by a scalar to compute their product. + /// The scalar to multiply with . + /// The vector to multiply with . + /// The product of and . + /// The type of the vector () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 operator *(T left, Vector512 right) => right * left; + + /// Computes the ones-complement of a vector. + /// The vector whose ones-complement is to be computed. + /// A vector whose elements are the ones-complement of the corresponding elements in . + /// The type of the vector () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 operator ~(Vector512 vector) + { + return Vector512.Create( + ~vector._lower, + ~vector._upper + ); + } + + /// Subtracts two vectors to compute their difference. + /// The vector from which will be subtracted. + /// The vector to subtract from . + /// The difference of and . + /// The type of the vector () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 operator -(Vector512 left, Vector512 right) + { + return Vector512.Create( + left._lower - right._lower, + left._upper - right._upper + ); + } + + /// Computes the unary negation of a vector. + /// The vector to negate. + /// A vector whose elements are the unary negation of the corresponding elements in . + /// The type of the vector () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 operator -(Vector512 vector) + { + return Vector512.Create( + -vector._lower, + -vector._upper + ); + } + + /// Returns a given vector unchanged. + /// The vector. + /// + /// The type of the vector () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 operator +(Vector512 value) + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + return value; + } + + /// Determines whether the specified object is equal to the current instance. + /// The object to compare with the current instance. + /// true if is a and is equal to the current instance; otherwise, false. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override bool Equals([NotNullWhen(true)] object? obj) => (obj is Vector512 other) && Equals(other); + + /// Determines whether the specified is equal to the current instance. + /// The to compare with the current instance. + /// true if is equal to the current instance; otherwise, false. + /// The type of the vector () is not supported. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(Vector512 other) + { + // This function needs to account for floating-point equality around NaN + // and so must behave equivalently to the underlying float/double.Equals + + if (Vector512.IsHardwareAccelerated) + { + if ((typeof(T) == typeof(double)) || (typeof(T) == typeof(float))) + { + Vector512 result = Vector512.Equals(this, other) | ~(Vector512.Equals(this, this) | Vector512.Equals(other, other)); + return result.AsInt32() == Vector512.AllBitsSet; + } + else + { + return this == other; + } + } + else + { + return _lower.Equals(other._lower) + && _upper.Equals(other._upper); + } + } + + /// Gets the hash code for the instance. + /// The hash code for the instance. + /// The type of the vector () is not supported. + public override int GetHashCode() + { + HashCode hashCode = default; + + for (int i = 0; i < Count; i++) + { + T value = this.GetElementUnsafe(i); + hashCode.Add(value); + } + + return hashCode.ToHashCode(); + } + + /// Converts the current instance to an equivalent string representation. + /// An equivalent string representation of the current instance. + /// The type of the vector () is not supported. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() => ToString("G", CultureInfo.InvariantCulture); + + private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format, IFormatProvider? formatProvider) + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + + var sb = new ValueStringBuilder(stackalloc char[64]); + string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; + + sb.Append('<'); + sb.Append(((IFormattable)this.GetElementUnsafe(0)).ToString(format, formatProvider)); + + for (int i = 1; i < Count; i++) + { + sb.Append(separator); + sb.Append(' '); + sb.Append(((IFormattable)this.GetElementUnsafe(i)).ToString(format, formatProvider)); + } + sb.Append('>'); + + return sb.ToString(); + } + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs b/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs index 1f0e03112c8f2b..9612eca14e1ad4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs @@ -687,6 +687,19 @@ internal static void ThrowForUnsupportedIntrinsicsVector256BaseType() } } + // Throws if 'T' is disallowed in Vector512 in the Intrinsics namespace. + // If 'T' is allowed, no-ops. JIT will elide the method entirely if 'T' + // is supported and we're on an optimized release build. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void ThrowForUnsupportedIntrinsicsVector512BaseType() + where T : struct + { + if (!Vector512.IsSupported) + { + ThrowNotSupportedException(ExceptionResource.Arg_TypeNotSupported); + } + } + #if false // Reflection-based implementation does not work for NativeAOT // This function will convert an ExceptionArgument enum value to the argument name string. [MethodImpl(MethodImplOptions.NoInlining)] diff --git a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs index f6a264e1d089f5..6da7f99a4a1759 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -544,6 +544,8 @@ public static void CopyTo(this System.Runtime.Intrinsics.Vector256 vector, public static System.Runtime.Intrinsics.Vector256 Subtract(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right) where T : struct { throw null; } public static T Sum(System.Runtime.Intrinsics.Vector256 vector) where T : struct { throw null; } public static T ToScalar(this System.Runtime.Intrinsics.Vector256 vector) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 ToVector512Unsafe(this System.Runtime.Intrinsics.Vector256 vector) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 ToVector512(this System.Runtime.Intrinsics.Vector256 vector) where T : struct { throw null; } public static bool TryCopyTo(this System.Runtime.Intrinsics.Vector256 vector, System.Span destination) where T : struct { throw null; } [System.CLSCompliantAttribute(false)] public static (System.Runtime.Intrinsics.Vector256 Lower, System.Runtime.Intrinsics.Vector256 Upper) Widen(System.Runtime.Intrinsics.Vector256 source) { throw null; } @@ -588,6 +590,293 @@ public static void CopyTo(this System.Runtime.Intrinsics.Vector256 vector, public static System.Runtime.Intrinsics.Vector256 operator +(System.Runtime.Intrinsics.Vector256 value) { throw null; } public override string ToString() { throw null; } } + public static partial class Vector512 + { + public static bool IsHardwareAccelerated { get { throw null; } } + public static System.Runtime.Intrinsics.Vector512 Abs(System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 Add(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 AndNot(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 AsByte(this System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 AsDouble(this System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 AsInt16(this System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 AsInt32(this System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 AsInt64(this System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 AsNInt(this System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 AsNUInt(this System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 AsSByte(this System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 AsSingle(this System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 AsUInt16(this System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 AsUInt32(this System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 AsUInt64(this System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 AsVector512(this System.Numerics.Vector value) where T : struct { throw null; } + public static System.Numerics.Vector AsVector(this System.Runtime.Intrinsics.Vector512 value) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 As(this System.Runtime.Intrinsics.Vector512 vector) where TFrom : struct where TTo : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 BitwiseAnd(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 BitwiseOr(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 Ceiling(System.Runtime.Intrinsics.Vector512 vector) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Ceiling(System.Runtime.Intrinsics.Vector512 vector) { throw null; } + public static System.Runtime.Intrinsics.Vector512 ConditionalSelect(System.Runtime.Intrinsics.Vector512 condition, System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 ConvertToDouble(System.Runtime.Intrinsics.Vector512 vector) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 ConvertToDouble(System.Runtime.Intrinsics.Vector512 vector) { throw null; } + public static System.Runtime.Intrinsics.Vector512 ConvertToInt32(System.Runtime.Intrinsics.Vector512 vector) { throw null; } + public static System.Runtime.Intrinsics.Vector512 ConvertToInt64(System.Runtime.Intrinsics.Vector512 vector) { throw null; } + public static System.Runtime.Intrinsics.Vector512 ConvertToSingle(System.Runtime.Intrinsics.Vector512 vector) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 ConvertToSingle(System.Runtime.Intrinsics.Vector512 vector) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 ConvertToUInt32(System.Runtime.Intrinsics.Vector512 vector) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 ConvertToUInt64(System.Runtime.Intrinsics.Vector512 vector) { throw null; } + public static void CopyTo(this System.Runtime.Intrinsics.Vector512 vector, System.Span destination) where T : struct { } + public static void CopyTo(this System.Runtime.Intrinsics.Vector512 vector, T[] destination) where T : struct { } + public static void CopyTo(this System.Runtime.Intrinsics.Vector512 vector, T[] destination, int startIndex) where T : struct { } + public static System.Runtime.Intrinsics.Vector512 Create(byte value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(byte e0, byte e1, byte e2, byte e3, byte e4, byte e5, byte e6, byte e7, byte e8, byte e9, byte e10, byte e11, byte e12, byte e13, byte e14, byte e15, byte e16, byte e17, byte e18, byte e19, byte e20, byte e21, byte e22, byte e23, byte e24, byte e25, byte e26, byte e27, byte e28, byte e29, byte e30, byte e31, byte e32, byte e33, byte e34, byte e35, byte e36, byte e37, byte e38, byte e39, byte e40, byte e41, byte e42, byte e43, byte e44, byte e45, byte e46, byte e47, byte e48, byte e49, byte e50, byte e51, byte e52, byte e53, byte e54, byte e55, byte e56, byte e57, byte e58, byte e59, byte e60, byte e61, byte e62, byte e63) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(double value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(double e0, double e1, double e2, double e3, double e4, double e5, double e6, double e7) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(short value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(short e0, short e1, short e2, short e3, short e4, short e5, short e6, short e7, short e8, short e9, short e10, short e11, short e12, short e13, short e14, short e15, short e16, short e17, short e18, short e19, short e20, short e21, short e22, short e23, short e24, short e25, short e26, short e27, short e28, short e29, short e30, short e31) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(int value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(int e0, int e1, int e2, int e3, int e4, int e5, int e6, int e7, int e8, int e9, int e10, int e11, int e12, int e13, int e14, int e15) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(long value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(long e0, long e1, long e2, long e3, long e4, long e5, long e6, long e7) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(nint value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Create(nuint value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(System.Runtime.Intrinsics.Vector256 lower, System.Runtime.Intrinsics.Vector256 upper) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(System.Runtime.Intrinsics.Vector256 lower, System.Runtime.Intrinsics.Vector256 upper) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(System.Runtime.Intrinsics.Vector256 lower, System.Runtime.Intrinsics.Vector256 upper) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(System.Runtime.Intrinsics.Vector256 lower, System.Runtime.Intrinsics.Vector256 upper) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(System.Runtime.Intrinsics.Vector256 lower, System.Runtime.Intrinsics.Vector256 upper) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Create(System.Runtime.Intrinsics.Vector256 lower, System.Runtime.Intrinsics.Vector256 upper) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(System.Runtime.Intrinsics.Vector256 lower, System.Runtime.Intrinsics.Vector256 upper) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Create(System.Runtime.Intrinsics.Vector256 lower, System.Runtime.Intrinsics.Vector256 upper) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Create(System.Runtime.Intrinsics.Vector256 lower, System.Runtime.Intrinsics.Vector256 upper) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Create(System.Runtime.Intrinsics.Vector256 lower, System.Runtime.Intrinsics.Vector256 upper) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Create(sbyte value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Create(sbyte e0, sbyte e1, sbyte e2, sbyte e3, sbyte e4, sbyte e5, sbyte e6, sbyte e7, sbyte e8, sbyte e9, sbyte e10, sbyte e11, sbyte e12, sbyte e13, sbyte e14, sbyte e15, sbyte e16, sbyte e17, sbyte e18, sbyte e19, sbyte e20, sbyte e21, sbyte e22, sbyte e23, sbyte e24, sbyte e25, sbyte e26, sbyte e27, sbyte e28, sbyte e29, sbyte e30, sbyte e31, sbyte e32, sbyte e33, sbyte e34, sbyte e35, sbyte e36, sbyte e37, sbyte e38, sbyte e39, sbyte e40, sbyte e41, sbyte e42, sbyte e43, sbyte e44, sbyte e45, sbyte e46, sbyte e47, sbyte e48, sbyte e49, sbyte e50, sbyte e51, sbyte e52, sbyte e53, sbyte e54, sbyte e55, sbyte e56, sbyte e57, sbyte e58, sbyte e59, sbyte e60, sbyte e61, sbyte e62, sbyte e63) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(float value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(float e0, float e1, float e2, float e3, float e4, float e5, float e6, float e7, float e8, float e9, float e10, float e11, float e12, float e13, float e14, float e15) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Create(ushort value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Create(ushort e0, ushort e1, ushort e2, ushort e3, ushort e4, ushort e5, ushort e6, ushort e7, ushort e8, ushort e9, ushort e10, ushort e11, ushort e12, ushort e13, ushort e14, ushort e15, ushort e16, ushort e17, ushort e18, ushort e19, ushort e20, ushort e21, ushort e22, ushort e23, ushort e24, ushort e25, ushort e26, ushort e27, ushort e28, ushort e29, ushort e30, ushort e31) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Create(uint value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Create(uint e0, uint e1, uint e2, uint e3, uint e4, uint e5, uint e6, uint e7, uint e8, uint e9, uint e10, uint e11, uint e12, uint e13, uint e14, uint e15) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Create(ulong value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Create(ulong e0, ulong e1, ulong e2, ulong e3, ulong e4, ulong e5, ulong e6, ulong e7) { throw null; } + public static System.Runtime.Intrinsics.Vector512 CreateScalar(byte value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 CreateScalar(double value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 CreateScalar(short value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 CreateScalar(int value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 CreateScalar(long value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 CreateScalar(nint value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 CreateScalar(nuint value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 CreateScalar(sbyte value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 CreateScalar(float value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 CreateScalar(ushort value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 CreateScalar(uint value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 CreateScalar(ulong value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 CreateScalarUnsafe(byte value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 CreateScalarUnsafe(double value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 CreateScalarUnsafe(short value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 CreateScalarUnsafe(int value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 CreateScalarUnsafe(long value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 CreateScalarUnsafe(nint value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 CreateScalarUnsafe(nuint value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 CreateScalarUnsafe(sbyte value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 CreateScalarUnsafe(float value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 CreateScalarUnsafe(ushort value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 CreateScalarUnsafe(uint value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 CreateScalarUnsafe(ulong value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(System.ReadOnlySpan values) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(T value) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(T[] values) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(T[] values, int index) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 Divide(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static T Dot(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static bool EqualsAll(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static bool EqualsAny(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 Equals(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + [System.CLSCompliantAttribute(false)] + public static ulong ExtractMostSignificantBits(this System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 Floor(System.Runtime.Intrinsics.Vector512 vector) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Floor(System.Runtime.Intrinsics.Vector512 vector) { throw null; } + public static T GetElement(this System.Runtime.Intrinsics.Vector512 vector, int index) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector256 GetLower(this System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector256 GetUpper(this System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + public static bool GreaterThanAll(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static bool GreaterThanAny(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static bool GreaterThanOrEqualAll(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static bool GreaterThanOrEqualAny(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 GreaterThanOrEqual(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 GreaterThan(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static bool LessThanAll(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static bool LessThanAny(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static bool LessThanOrEqualAll(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static bool LessThanOrEqualAny(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 LessThanOrEqual(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 LessThan(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + [System.CLSCompliantAttribute(false)] + public static unsafe System.Runtime.Intrinsics.Vector512 Load(T* source) where T : unmanaged { throw null; } + [System.CLSCompliantAttribute(false)] + public static unsafe System.Runtime.Intrinsics.Vector512 LoadAligned(T* source) where T : unmanaged { throw null; } + [System.CLSCompliantAttribute(false)] + public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedNonTemporal(T* source) where T : unmanaged { throw null; } + public static System.Runtime.Intrinsics.Vector512 LoadUnsafe(ref T source) where T : struct { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 LoadUnsafe(ref T source, nuint elementOffset) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 Max(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 Min(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 Multiply(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 Multiply(System.Runtime.Intrinsics.Vector512 left, T right) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 Multiply(T left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 Narrow(System.Runtime.Intrinsics.Vector512 lower, System.Runtime.Intrinsics.Vector512 upper) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Narrow(System.Runtime.Intrinsics.Vector512 lower, System.Runtime.Intrinsics.Vector512 upper) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Narrow(System.Runtime.Intrinsics.Vector512 lower, System.Runtime.Intrinsics.Vector512 upper) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Narrow(System.Runtime.Intrinsics.Vector512 lower, System.Runtime.Intrinsics.Vector512 upper) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Narrow(System.Runtime.Intrinsics.Vector512 lower, System.Runtime.Intrinsics.Vector512 upper) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Narrow(System.Runtime.Intrinsics.Vector512 lower, System.Runtime.Intrinsics.Vector512 upper) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Narrow(System.Runtime.Intrinsics.Vector512 lower, System.Runtime.Intrinsics.Vector512 upper) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Negate(System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 OnesComplement(System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 ShiftLeft(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + public static System.Runtime.Intrinsics.Vector512 ShiftLeft(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + public static System.Runtime.Intrinsics.Vector512 ShiftLeft(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + public static System.Runtime.Intrinsics.Vector512 ShiftLeft(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + public static System.Runtime.Intrinsics.Vector512 ShiftLeft(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 ShiftLeft(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 ShiftLeft(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 ShiftLeft(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 ShiftLeft(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 ShiftLeft(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + public static System.Runtime.Intrinsics.Vector512 ShiftRightArithmetic(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + public static System.Runtime.Intrinsics.Vector512 ShiftRightArithmetic(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + public static System.Runtime.Intrinsics.Vector512 ShiftRightArithmetic(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + public static System.Runtime.Intrinsics.Vector512 ShiftRightArithmetic(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 ShiftRightArithmetic(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + public static System.Runtime.Intrinsics.Vector512 ShiftRightLogical(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + public static System.Runtime.Intrinsics.Vector512 ShiftRightLogical(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + public static System.Runtime.Intrinsics.Vector512 ShiftRightLogical(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + public static System.Runtime.Intrinsics.Vector512 ShiftRightLogical(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + public static System.Runtime.Intrinsics.Vector512 ShiftRightLogical(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 ShiftRightLogical(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 ShiftRightLogical(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 ShiftRightLogical(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 ShiftRightLogical(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 ShiftRightLogical(System.Runtime.Intrinsics.Vector512 vector, int shiftCount) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Shuffle(System.Runtime.Intrinsics.Vector512 vector, System.Runtime.Intrinsics.Vector512 indices) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Shuffle(System.Runtime.Intrinsics.Vector512 vector, System.Runtime.Intrinsics.Vector512 indices) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Shuffle(System.Runtime.Intrinsics.Vector512 vector, System.Runtime.Intrinsics.Vector512 indices) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Shuffle(System.Runtime.Intrinsics.Vector512 vector, System.Runtime.Intrinsics.Vector512 indices) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Shuffle(System.Runtime.Intrinsics.Vector512 vector, System.Runtime.Intrinsics.Vector512 indices) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Shuffle(System.Runtime.Intrinsics.Vector512 vector, System.Runtime.Intrinsics.Vector512 indices) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Shuffle(System.Runtime.Intrinsics.Vector512 vector, System.Runtime.Intrinsics.Vector512 indices) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Shuffle(System.Runtime.Intrinsics.Vector512 vector, System.Runtime.Intrinsics.Vector512 indices) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Shuffle(System.Runtime.Intrinsics.Vector512 vector, System.Runtime.Intrinsics.Vector512 indices) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Shuffle(System.Runtime.Intrinsics.Vector512 vector, System.Runtime.Intrinsics.Vector512 indices) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Sqrt(System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + [System.CLSCompliantAttribute(false)] + public static unsafe void Store(this System.Runtime.Intrinsics.Vector512 source, T* destination) where T : unmanaged { throw null; } + [System.CLSCompliantAttribute(false)] + public static unsafe void StoreAligned(this System.Runtime.Intrinsics.Vector512 source, T* destination) where T : unmanaged { throw null; } + [System.CLSCompliantAttribute(false)] + public static unsafe void StoreAlignedNonTemporal(this System.Runtime.Intrinsics.Vector512 source, T* destination) where T : unmanaged { throw null; } + public static void StoreUnsafe(this System.Runtime.Intrinsics.Vector512 source, ref T destination) where T : struct { throw null; } + [System.CLSCompliantAttribute(false)] + public static void StoreUnsafe(this System.Runtime.Intrinsics.Vector512 source, ref T destination, nuint elementOffset) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 Subtract(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static T Sum(System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + public static T ToScalar(this System.Runtime.Intrinsics.Vector512 vector) where T : struct { throw null; } + public static bool TryCopyTo(this System.Runtime.Intrinsics.Vector512 vector, System.Span destination) where T : struct { throw null; } + [System.CLSCompliantAttribute(false)] + public static (System.Runtime.Intrinsics.Vector512 Lower, System.Runtime.Intrinsics.Vector512 Upper) Widen(System.Runtime.Intrinsics.Vector512 source) { throw null; } + public static (System.Runtime.Intrinsics.Vector512 Lower, System.Runtime.Intrinsics.Vector512 Upper) Widen(System.Runtime.Intrinsics.Vector512 source) { throw null; } + public static (System.Runtime.Intrinsics.Vector512 Lower, System.Runtime.Intrinsics.Vector512 Upper) Widen(System.Runtime.Intrinsics.Vector512 source) { throw null; } + [System.CLSCompliantAttribute(false)] + public static (System.Runtime.Intrinsics.Vector512 Lower, System.Runtime.Intrinsics.Vector512 Upper) Widen(System.Runtime.Intrinsics.Vector512 source) { throw null; } + public static (System.Runtime.Intrinsics.Vector512 Lower, System.Runtime.Intrinsics.Vector512 Upper) Widen(System.Runtime.Intrinsics.Vector512 source) { throw null; } + [System.CLSCompliantAttribute(false)] + public static (System.Runtime.Intrinsics.Vector512 Lower, System.Runtime.Intrinsics.Vector512 Upper) Widen(System.Runtime.Intrinsics.Vector512 source) { throw null; } + [System.CLSCompliantAttribute(false)] + public static (System.Runtime.Intrinsics.Vector512 Lower, System.Runtime.Intrinsics.Vector512 Upper) Widen(System.Runtime.Intrinsics.Vector512 source) { throw null; } + public static System.Runtime.Intrinsics.Vector512 WithElement(this System.Runtime.Intrinsics.Vector512 vector, int index, T value) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 WithLower(this System.Runtime.Intrinsics.Vector512 vector, System.Runtime.Intrinsics.Vector256 value) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 WithUpper(this System.Runtime.Intrinsics.Vector512 vector, System.Runtime.Intrinsics.Vector256 value) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 Xor(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + } + public readonly partial struct Vector512 : System.IEquatable> where T : struct + { + private readonly int _dummyPrimitive; + public static System.Runtime.Intrinsics.Vector512 AllBitsSet { get { throw null; } } + public static bool IsSupported { get { throw null; } } + public static int Count { get { throw null; } } + public static System.Runtime.Intrinsics.Vector512 Zero { get { throw null; } } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public bool Equals(System.Runtime.Intrinsics.Vector512 other) { throw null; } + public override int GetHashCode() { throw null; } + public T this[int index] { get { throw null; } } + public static System.Runtime.Intrinsics.Vector512 operator +(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } + public static System.Runtime.Intrinsics.Vector512 operator &(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } + public static System.Runtime.Intrinsics.Vector512 operator |(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } + public static System.Runtime.Intrinsics.Vector512 operator /(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } + public static bool operator ==(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } + public static System.Runtime.Intrinsics.Vector512 operator ^(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } + public static bool operator !=(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } + public static System.Runtime.Intrinsics.Vector512 operator *(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } + public static System.Runtime.Intrinsics.Vector512 operator *(System.Runtime.Intrinsics.Vector512 left, T right) { throw null; } + public static System.Runtime.Intrinsics.Vector512 operator *(T left, System.Runtime.Intrinsics.Vector512 right) { throw null; } + public static System.Runtime.Intrinsics.Vector512 operator ~(System.Runtime.Intrinsics.Vector512 vector) { throw null; } + public static System.Runtime.Intrinsics.Vector512 operator -(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } + public static System.Runtime.Intrinsics.Vector512 operator -(System.Runtime.Intrinsics.Vector512 vector) { throw null; } + public static System.Runtime.Intrinsics.Vector512 operator +(System.Runtime.Intrinsics.Vector512 value) { throw null; } + public override string ToString() { throw null; } + } public static partial class Vector64 { public static bool IsHardwareAccelerated { get { throw null; } } diff --git a/src/libraries/System.Runtime.Intrinsics/tests/System.Runtime.Intrinsics.Tests.csproj b/src/libraries/System.Runtime.Intrinsics/tests/System.Runtime.Intrinsics.Tests.csproj index 3009539cc05335..0172cd14a4240a 100644 --- a/src/libraries/System.Runtime.Intrinsics/tests/System.Runtime.Intrinsics.Tests.csproj +++ b/src/libraries/System.Runtime.Intrinsics/tests/System.Runtime.Intrinsics.Tests.csproj @@ -11,6 +11,7 @@ + diff --git a/src/libraries/System.Runtime.Intrinsics/tests/Vectors/Vector512Tests.cs b/src/libraries/System.Runtime.Intrinsics/tests/Vectors/Vector512Tests.cs new file mode 100644 index 00000000000000..4922cf8cab8583 --- /dev/null +++ b/src/libraries/System.Runtime.Intrinsics/tests/Vectors/Vector512Tests.cs @@ -0,0 +1,5088 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection; +using System.Runtime.InteropServices; +using Xunit; + +namespace System.Runtime.Intrinsics.Tests.Vectors +{ + public sealed class Vector512Tests + { + [Fact] + public unsafe void Vector512IsHardwareAcceleratedTest() + { + MethodInfo methodInfo = typeof(Vector512).GetMethod("get_IsHardwareAccelerated"); + Assert.Equal(Vector512.IsHardwareAccelerated, methodInfo.Invoke(null, null)); + } + + [Fact] + public unsafe void Vector512ByteExtractMostSignificantBitsTest() + { + Vector512 vector = Vector512.Create( + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80 + ); + + ulong result = Vector512.ExtractMostSignificantBits(vector); + Assert.Equal(0b10101010_10101010_10101010_10101010_10101010_10101010_10101010_10101010UL, result); + } + + [Fact] + public unsafe void Vector512DoubleExtractMostSignificantBitsTest() + { + Vector512 vector = Vector512.Create( + +1.0, + -0.0, + +1.0, + -0.0, + +1.0, + -0.0, + +1.0, + -0.0 + ); + + ulong result = Vector512.ExtractMostSignificantBits(vector); + Assert.Equal(0b10101010UL, result); + } + + [Fact] + public unsafe void Vector512Int16ExtractMostSignificantBitsTest() + { + Vector512 vector = Vector512.Create( + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000 + ).AsInt16(); + + ulong result = Vector512.ExtractMostSignificantBits(vector); + Assert.Equal(0b10101010_10101010_10101010_10101010UL, result); + } + + [Fact] + public unsafe void Vector512Int32ExtractMostSignificantBitsTest() + { + Vector512 vector = Vector512.Create( + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U + ).AsInt32(); + + ulong result = Vector512.ExtractMostSignificantBits(vector); + Assert.Equal(0b10101010_10101010UL, result); + } + + [Fact] + public unsafe void Vector512Int64ExtractMostSignificantBitsTest() + { + Vector512 vector = Vector512.Create( + 0x0000000000000001UL, + 0x8000000000000000UL, + 0x0000000000000001UL, + 0x8000000000000000UL, + 0x0000000000000001UL, + 0x8000000000000000UL, + 0x0000000000000001UL, + 0x8000000000000000UL + ).AsInt64(); + + ulong result = Vector512.ExtractMostSignificantBits(vector); + Assert.Equal(0b1010_1010UL, result); + } + + [Fact] + public unsafe void Vector512NIntExtractMostSignificantBitsTest() + { + if (Environment.Is64BitProcess) + { + Vector512 vector = Vector512.Create( + 0x0000000000000001UL, + 0x8000000000000000UL, + 0x0000000000000001UL, + 0x8000000000000000UL, + 0x0000000000000001UL, + 0x8000000000000000UL, + 0x0000000000000001UL, + 0x8000000000000000UL + ).AsNInt(); + + ulong result = Vector512.ExtractMostSignificantBits(vector); + Assert.Equal(0b10101010UL, result); + } + else + { + Vector512 vector = Vector512.Create( + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U + ).AsNInt(); + + ulong result = Vector512.ExtractMostSignificantBits(vector); + Assert.Equal(0b10101010_10101010UL, result); + } + } + + [Fact] + public unsafe void Vector512NUIntExtractMostSignificantBitsTest() + { + if (Environment.Is64BitProcess) + { + Vector512 vector = Vector512.Create( + 0x0000000000000001UL, + 0x8000000000000000UL, + 0x0000000000000001UL, + 0x8000000000000000UL, + 0x0000000000000001UL, + 0x8000000000000000UL, + 0x0000000000000001UL, + 0x8000000000000000UL + ).AsNUInt(); + + ulong result = Vector512.ExtractMostSignificantBits(vector); + Assert.Equal(0b10101010UL, result); + } + else + { + Vector512 vector = Vector512.Create( + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U + ).AsNUInt(); + + ulong result = Vector512.ExtractMostSignificantBits(vector); + Assert.Equal(0b10101010_10101010UL, result); + } + } + + [Fact] + public unsafe void Vector512SByteExtractMostSignificantBitsTest() + { + Vector512 vector = Vector512.Create( + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80 + ).AsSByte(); + + ulong result = Vector512.ExtractMostSignificantBits(vector); + Assert.Equal(0b10101010_10101010_10101010_10101010_10101010_10101010_10101010_10101010UL, result); + } + + [Fact] + public unsafe void Vector512SingleExtractMostSignificantBitsTest() + { + Vector512 vector = Vector512.Create( + +1.0f, + -0.0f, + +1.0f, + -0.0f, + +1.0f, + -0.0f, + +1.0f, + -0.0f, + +1.0f, + -0.0f, + +1.0f, + -0.0f, + +1.0f, + -0.0f, + +1.0f, + -0.0f + ); + + ulong result = Vector512.ExtractMostSignificantBits(vector); + Assert.Equal(0b10101010_10101010UL, result); + } + + [Fact] + public unsafe void Vector512UInt16ExtractMostSignificantBitsTest() + { + Vector512 vector = Vector512.Create( + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000, + 0x0001, + 0x8000 + ); + + ulong result = Vector512.ExtractMostSignificantBits(vector); + Assert.Equal(0b10101010_10101010_10101010_10101010UL, result); + } + + [Fact] + public unsafe void Vector512UInt32ExtractMostSignificantBitsTest() + { + Vector512 vector = Vector512.Create( + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U, + 0x00000001U, + 0x80000000U + ); + + ulong result = Vector512.ExtractMostSignificantBits(vector); + Assert.Equal(0b10101010_10101010UL, result); + } + + [Fact] + public unsafe void Vector512UInt64ExtractMostSignificantBitsTest() + { + Vector512 vector = Vector512.Create( + 0x0000000000000001UL, + 0x8000000000000000UL, + 0x0000000000000001UL, + 0x8000000000000000UL, + 0x0000000000000001UL, + 0x8000000000000000UL, + 0x0000000000000001UL, + 0x8000000000000000UL + ); + + ulong result = Vector512.ExtractMostSignificantBits(vector); + Assert.Equal(0b10101010UL, result); + } + + [Fact] + public unsafe void Vector512ByteLoadTest() + { + byte* value = stackalloc byte[64]; + + for (int index = 0; index < 64; index++) + { + value[index] = (byte)(index); + } + + Vector512 vector = Vector512.Load(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((byte)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512DoubleLoadTest() + { + double* value = stackalloc double[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.Load(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((double)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512Int16LoadTest() + { + short* value = stackalloc short[32]; + + for (int index = 0; index < 32; index++) + { + value[index] = (short)(index); + } + + Vector512 vector = Vector512.Load(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((short)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512Int32LoadTest() + { + int* value = stackalloc int[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.Load(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((int)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512Int64LoadTest() + { + long* value = stackalloc long[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.Load(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((long)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512NIntLoadTest() + { + if (Environment.Is64BitProcess) + { + nint* value = stackalloc nint[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.Load(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nint)index, vector.GetElement(index)); + } + } + else + { + nint* value = stackalloc nint[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.Load(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nint)index, vector.GetElement(index)); + } + } + } + + [Fact] + public unsafe void Vector512NUIntLoadTest() + { + if (Environment.Is64BitProcess) + { + nuint* value = stackalloc nuint[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = (nuint)(index); + } + + Vector512 vector = Vector512.Load(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nuint)index, vector.GetElement(index)); + } + } + else + { + nuint* value = stackalloc nuint[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = (nuint)(index); + } + + Vector512 vector = Vector512.Load(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nuint)index, vector.GetElement(index)); + } + } + } + + [Fact] + public unsafe void Vector512SByteLoadTest() + { + sbyte* value = stackalloc sbyte[64]; + + for (int index = 0; index < 64; index++) + { + value[index] = (sbyte)(index); + } + + Vector512 vector = Vector512.Load(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((sbyte)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512SingleLoadTest() + { + float* value = stackalloc float[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.Load(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((float)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512UInt16LoadTest() + { + ushort* value = stackalloc ushort[32]; + + for (int index = 0; index < 32; index++) + { + value[index] = (ushort)(index); + } + + Vector512 vector = Vector512.Load(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ushort)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512UInt32LoadTest() + { + uint* value = stackalloc uint[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = (uint)(index); + } + + Vector512 vector = Vector512.Load(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((uint)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512UInt64LoadTest() + { + ulong* value = stackalloc ulong[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = (ulong)(index); + } + + Vector512 vector = Vector512.Load(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ulong)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512ByteLoadAlignedTest() + { + byte* value = null; + + try + { + value = (byte*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 64; index++) + { + value[index] = (byte)(index); + } + + Vector512 vector = Vector512.LoadAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((byte)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512DoubleLoadAlignedTest() + { + double* value = null; + + try + { + value = (double*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((double)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512Int16LoadAlignedTest() + { + short* value = null; + + try + { + value = (short*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 32; index++) + { + value[index] = (short)(index); + } + + Vector512 vector = Vector512.LoadAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((short)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512Int32LoadAlignedTest() + { + int* value = null; + + try + { + value = (int*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((int)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512Int64LoadAlignedTest() + { + long* value = null; + + try + { + value = (long*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((long)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512NIntLoadAlignedTest() + { + nint* value = null; + + try + { + value = (nint*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + if (Environment.Is64BitProcess) + { + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + } + else + { + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + } + + Vector512 vector = Vector512.LoadAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nint)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512NUIntLoadAlignedTest() + { + nuint* value = null; + + try + { + value = (nuint*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + if (Environment.Is64BitProcess) + { + for (int index = 0; index < 8; index++) + { + value[index] = (nuint)(index); + } + } + else + { + for (int index = 0; index < 16; index++) + { + value[index] = (nuint)(index); + } + } + + Vector512 vector = Vector512.LoadAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nuint)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512SByteLoadAlignedTest() + { + sbyte* value = null; + + try + { + value = (sbyte*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 64; index++) + { + value[index] = (sbyte)(index); + } + + Vector512 vector = Vector512.LoadAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((sbyte)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512SingleLoadAlignedTest() + { + float* value = null; + + try + { + value = (float*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((float)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512UInt16LoadAlignedTest() + { + ushort* value = null; + + try + { + value = (ushort*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 32; index++) + { + value[index] = (ushort)(index); + } + + Vector512 vector = Vector512.LoadAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ushort)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512UInt32LoadAlignedTest() + { + uint* value = null; + + try + { + value = (uint*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 16; index++) + { + value[index] = (uint)(index); + } + + Vector512 vector = Vector512.LoadAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((uint)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512UInt64LoadAlignedTest() + { + ulong* value = null; + + try + { + value = (ulong*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 8; index++) + { + value[index] = (ulong)(index); + } + + Vector512 vector = Vector512.LoadAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ulong)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512ByteLoadAlignedNonTemporalTest() + { + byte* value = null; + + try + { + value = (byte*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 64; index++) + { + value[index] = (byte)(index); + } + + Vector512 vector = Vector512.LoadAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((byte)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512DoubleLoadAlignedNonTemporalTest() + { + double* value = null; + + try + { + value = (double*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((double)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512Int16LoadAlignedNonTemporalTest() + { + short* value = null; + + try + { + value = (short*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 32; index++) + { + value[index] = (short)(index); + } + + Vector512 vector = Vector512.LoadAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((short)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512Int32LoadAlignedNonTemporalTest() + { + int* value = null; + + try + { + value = (int*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((int)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512Int64LoadAlignedNonTemporalTest() + { + long* value = null; + + try + { + value = (long*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((long)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512NIntLoadAlignedNonTemporalTest() + { + nint* value = null; + + try + { + value = (nint*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + if (Environment.Is64BitProcess) + { + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + } + else + { + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + } + + Vector512 vector = Vector512.LoadAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nint)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512NUIntLoadAlignedNonTemporalTest() + { + nuint* value = null; + + try + { + value = (nuint*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + if (Environment.Is64BitProcess) + { + for (int index = 0; index < 8; index++) + { + value[index] = (nuint)(index); + } + } + else + { + for (int index = 0; index < 16; index++) + { + value[index] = (nuint)(index); + } + } + + Vector512 vector = Vector512.LoadAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nuint)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512SByteLoadAlignedNonTemporalTest() + { + sbyte* value = null; + + try + { + value = (sbyte*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 64; index++) + { + value[index] = (sbyte)(index); + } + + Vector512 vector = Vector512.LoadAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((sbyte)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512SingleLoadAlignedNonTemporalTest() + { + float* value = null; + + try + { + value = (float*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((float)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512UInt16LoadAlignedNonTemporalTest() + { + ushort* value = null; + + try + { + value = (ushort*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 32; index++) + { + value[index] = (ushort)(index); + } + + Vector512 vector = Vector512.LoadAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ushort)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512UInt32LoadAlignedNonTemporalTest() + { + uint* value = null; + + try + { + value = (uint*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 16; index++) + { + value[index] = (uint)(index); + } + + Vector512 vector = Vector512.LoadAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((uint)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512UInt64LoadAlignedNonTemporalTest() + { + ulong* value = null; + + try + { + value = (ulong*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 8; index++) + { + value[index] = (ulong)(index); + } + + Vector512 vector = Vector512.LoadAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ulong)index, vector.GetElement(index)); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512ByteLoadUnsafeTest() + { + byte* value = stackalloc byte[64]; + + for (int index = 0; index < 64; index++) + { + value[index] = (byte)(index); + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((byte)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512DoubleLoadUnsafeTest() + { + double* value = stackalloc double[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((double)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512Int16LoadUnsafeTest() + { + short* value = stackalloc short[32]; + + for (int index = 0; index < 32; index++) + { + value[index] = (short)(index); + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((short)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512Int32LoadUnsafeTest() + { + int* value = stackalloc int[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((int)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512Int64LoadUnsafeTest() + { + long* value = stackalloc long[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((long)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512NIntLoadUnsafeTest() + { + if (Environment.Is64BitProcess) + { + nint* value = stackalloc nint[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nint)index, vector.GetElement(index)); + } + } + else + { + nint* value = stackalloc nint[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nint)index, vector.GetElement(index)); + } + } + } + + [Fact] + public unsafe void Vector512NUIntLoadUnsafeTest() + { + if (Environment.Is64BitProcess) + { + nuint* value = stackalloc nuint[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = (nuint)(index); + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nuint)index, vector.GetElement(index)); + } + } + else + { + nuint* value = stackalloc nuint[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = (nuint)(index); + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nuint)index, vector.GetElement(index)); + } + } + } + + [Fact] + public unsafe void Vector512SByteLoadUnsafeTest() + { + sbyte* value = stackalloc sbyte[64]; + + for (int index = 0; index < 64; index++) + { + value[index] = (sbyte)(index); + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((sbyte)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512SingleLoadUnsafeTest() + { + float* value = stackalloc float[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((float)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512UInt16LoadUnsafeTest() + { + ushort* value = stackalloc ushort[32]; + + for (int index = 0; index < 32; index++) + { + value[index] = (ushort)(index); + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ushort)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512UInt32LoadUnsafeTest() + { + uint* value = stackalloc uint[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = (uint)(index); + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((uint)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512UInt64LoadUnsafeTest() + { + ulong* value = stackalloc ulong[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = (ulong)(index); + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ulong)index, vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512ByteLoadUnsafeIndexTest() + { + byte* value = stackalloc byte[64 + 1]; + + for (int index = 0; index < 64 + 1; index++) + { + value[index] = (byte)(index); + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((byte)(index + 1), vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512DoubleLoadUnsafeIndexTest() + { + double* value = stackalloc double[8 + 1]; + + for (int index = 0; index < 8 + 1; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((double)(index + 1), vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512Int16LoadUnsafeIndexTest() + { + short* value = stackalloc short[32 + 1]; + + for (int index = 0; index < 32 + 1; index++) + { + value[index] = (short)(index); + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((short)(index + 1), vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512Int32LoadUnsafeIndexTest() + { + int* value = stackalloc int[16 + 1]; + + for (int index = 0; index < 16 + 1; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((int)(index + 1), vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512Int64LoadUnsafeIndexTest() + { + long* value = stackalloc long[8 + 1]; + + for (int index = 0; index < 8 + 1; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((long)(index + 1), vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512NIntLoadUnsafeIndexTest() + { + if (Environment.Is64BitProcess) + { + nint* value = stackalloc nint[8 + 1]; + + for (int index = 0; index < 8 + 1; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nint)(index + 1), vector.GetElement(index)); + } + } + else + { + nint* value = stackalloc nint[16 + 1]; + + for (int index = 0; index < 16 + 1; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nint)(index + 1), vector.GetElement(index)); + } + } + } + + [Fact] + public unsafe void Vector512NUIntLoadUnsafeIndexTest() + { + if (Environment.Is64BitProcess) + { + nuint* value = stackalloc nuint[8 + 1]; + + for (int index = 0; index < 8 + 1; index++) + { + value[index] = (nuint)(index); + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nuint)(index + 1), vector.GetElement(index)); + } + } + else + { + nuint* value = stackalloc nuint[16 + 1]; + + for (int index = 0; index < 16 + 1; index++) + { + value[index] = (nuint)(index); + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nuint)(index + 1), vector.GetElement(index)); + } + } + } + + [Fact] + public unsafe void Vector512SByteLoadUnsafeIndexTest() + { + sbyte* value = stackalloc sbyte[64 + 1]; + + for (int index = 0; index < 64 + 1; index++) + { + value[index] = (sbyte)(index); + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((sbyte)(index + 1), vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512SingleLoadUnsafeIndexTest() + { + float* value = stackalloc float[16 + 1]; + + for (int index = 0; index < 16 + 1; index++) + { + value[index] = index; + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((float)(index + 1), vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512UInt16LoadUnsafeIndexTest() + { + ushort* value = stackalloc ushort[32 + 1]; + + for (int index = 0; index < 32 + 1; index++) + { + value[index] = (ushort)(index); + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ushort)(index + 1), vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512UInt32LoadUnsafeIndexTest() + { + uint* value = stackalloc uint[16 + 1]; + + for (int index = 0; index < 16 + 1; index++) + { + value[index] = (uint)(index); + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((uint)(index + 1), vector.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512UInt64LoadUnsafeIndexTest() + { + ulong* value = stackalloc ulong[8 + 1]; + + for (int index = 0; index < 8 + 1; index++) + { + value[index] = (ulong)(index); + } + + Vector512 vector = Vector512.LoadUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ulong)(index + 1), vector.GetElement(index)); + } + } + + [Fact] + public void Vector512ByteShiftLeftTest() + { + Vector512 vector = Vector512.Create((byte)0x01); + vector = Vector512.ShiftLeft(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((byte)0x10, vector.GetElement(index)); + } + } + + [Fact] + public void Vector512Int16ShiftLeftTest() + { + Vector512 vector = Vector512.Create((short)0x01); + vector = Vector512.ShiftLeft(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((short)0x10, vector.GetElement(index)); + } + } + + [Fact] + public void Vector512Int32ShiftLeftTest() + { + Vector512 vector = Vector512.Create((int)0x01); + vector = Vector512.ShiftLeft(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((int)0x10, vector.GetElement(index)); + } + } + + [Fact] + public void Vector512Int64ShiftLeftTest() + { + Vector512 vector = Vector512.Create((long)0x01); + vector = Vector512.ShiftLeft(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((long)0x10, vector.GetElement(index)); + } + } + + [Fact] + public void Vector512NIntShiftLeftTest() + { + Vector512 vector = Vector512.Create((nint)0x01); + vector = Vector512.ShiftLeft(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nint)0x10, vector.GetElement(index)); + } + } + + [Fact] + public void Vector512NUIntShiftLeftTest() + { + Vector512 vector = Vector512.Create((nuint)0x01); + vector = Vector512.ShiftLeft(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nuint)0x10, vector.GetElement(index)); + } + } + + [Fact] + public void Vector512SByteShiftLeftTest() + { + Vector512 vector = Vector512.Create((sbyte)0x01); + vector = Vector512.ShiftLeft(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((sbyte)0x10, vector.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt16ShiftLeftTest() + { + Vector512 vector = Vector512.Create((ushort)0x01); + vector = Vector512.ShiftLeft(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ushort)0x10, vector.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt32ShiftLeftTest() + { + Vector512 vector = Vector512.Create((uint)0x01); + vector = Vector512.ShiftLeft(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((uint)0x10, vector.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt64ShiftLeftTest() + { + Vector512 vector = Vector512.Create((ulong)0x01); + vector = Vector512.ShiftLeft(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ulong)0x10, vector.GetElement(index)); + } + } + + [Fact] + public void Vector512Int16ShiftRightArithmeticTest() + { + Vector512 vector = Vector512.Create(unchecked((short)0x8000)); + vector = Vector512.ShiftRightArithmetic(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal(unchecked((short)0xF800), vector.GetElement(index)); + } + } + + [Fact] + public void Vector512Int32ShiftRightArithmeticTest() + { + Vector512 vector = Vector512.Create(unchecked((int)0x80000000)); + vector = Vector512.ShiftRightArithmetic(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal(unchecked((int)0xF8000000), vector.GetElement(index)); + } + } + + [Fact] + public void Vector512Int64ShiftRightArithmeticTest() + { + Vector512 vector = Vector512.Create(unchecked((long)0x8000000000000000)); + vector = Vector512.ShiftRightArithmetic(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal(unchecked((long)0xF800000000000000), vector.GetElement(index)); + } + } + + [Fact] + public void Vector512NIntShiftRightArithmeticTest() + { + if (Environment.Is64BitProcess) + { + Vector512 vector = Vector512.Create(unchecked((nint)0x8000000000000000)); + vector = Vector512.ShiftRightArithmetic(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal(unchecked((nint)0xF800000000000000), vector.GetElement(index)); + } + } + else + { + Vector512 vector = Vector512.Create(unchecked((nint)0x80000000)); + vector = Vector512.ShiftRightArithmetic(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal(unchecked((nint)0xF8000000), vector.GetElement(index)); + } + } + } + + [Fact] + public void Vector512SByteShiftRightArithmeticTest() + { + Vector512 vector = Vector512.Create(unchecked((sbyte)0x80)); + vector = Vector512.ShiftRightArithmetic(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal(unchecked((sbyte)0xF8), vector.GetElement(index)); + } + } + + [Fact] + public void Vector512ByteShiftRightLogicalTest() + { + Vector512 vector = Vector512.Create((byte)0x80); + vector = Vector512.ShiftRightLogical(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((byte)0x08, vector.GetElement(index)); + } + } + + [Fact] + public void Vector512Int16ShiftRightLogicalTest() + { + Vector512 vector = Vector512.Create(unchecked((short)0x8000)); + vector = Vector512.ShiftRightLogical(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((short)0x0800, vector.GetElement(index)); + } + } + + [Fact] + public void Vector512Int32ShiftRightLogicalTest() + { + Vector512 vector = Vector512.Create(unchecked((int)0x80000000)); + vector = Vector512.ShiftRightLogical(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((int)0x08000000, vector.GetElement(index)); + } + } + + [Fact] + public void Vector512Int64ShiftRightLogicalTest() + { + Vector512 vector = Vector512.Create(unchecked((long)0x8000000000000000)); + vector = Vector512.ShiftRightLogical(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((long)0x0800000000000000, vector.GetElement(index)); + } + } + + [Fact] + public void Vector512NIntShiftRightLogicalTest() + { + if (Environment.Is64BitProcess) + { + Vector512 vector = Vector512.Create(unchecked((nint)0x8000000000000000)); + vector = Vector512.ShiftRightLogical(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal(unchecked((nint)0x0800000000000000), vector.GetElement(index)); + } + } + else + { + Vector512 vector = Vector512.Create(unchecked((nint)0x80000000)); + vector = Vector512.ShiftRightLogical(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal(unchecked((nint)0x08000000), vector.GetElement(index)); + } + } + } + + [Fact] + public void Vector512NUIntShiftRightLogicalTest() + { + if (Environment.Is64BitProcess) + { + Vector512 vector = Vector512.Create(unchecked((nuint)0x8000000000000000)); + vector = Vector512.ShiftRightLogical(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal(unchecked((nuint)0x0800000000000000), vector.GetElement(index)); + } + } + else + { + Vector512 vector = Vector512.Create(unchecked((nuint)0x80000000)); + vector = Vector512.ShiftRightLogical(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal(unchecked((nuint)0x08000000), vector.GetElement(index)); + } + } + } + + [Fact] + public void Vector512SByteShiftRightLogicalTest() + { + Vector512 vector = Vector512.Create(unchecked((sbyte)0x80)); + vector = Vector512.ShiftRightLogical(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((sbyte)0x08, vector.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt16ShiftRightLogicalTest() + { + Vector512 vector = Vector512.Create(unchecked((ushort)0x8000)); + vector = Vector512.ShiftRightLogical(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ushort)0x0800, vector.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt32ShiftRightLogicalTest() + { + Vector512 vector = Vector512.Create(0x80000000); + vector = Vector512.ShiftRightLogical(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((uint)0x08000000, vector.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt64ShiftRightLogicalTest() + { + Vector512 vector = Vector512.Create(0x8000000000000000); + vector = Vector512.ShiftRightLogical(vector, 4); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ulong)0x0800000000000000, vector.GetElement(index)); + } + } + + [Fact] + public void Vector512ByteShuffleOneInputTest() + { + Vector512 vector = Vector512.Create((byte)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64); + Vector512 result = Vector512.Shuffle(vector, Vector512.Create((byte)63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((byte)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512DoubleShuffleOneInputTest() + { + Vector512 vector = Vector512.Create((double)1, 2, 3, 4, 5, 6, 7, 8); + Vector512 result = Vector512.Shuffle(vector, Vector512.Create((long)7, 6, 5, 4, 3, 2, 1, 0)); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((double)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int16ShuffleOneInputTest() + { + Vector512 vector = Vector512.Create((short)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); + Vector512 result = Vector512.Shuffle(vector, Vector512.Create((short)31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((short)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int32ShuffleOneInputTest() + { + Vector512 vector = Vector512.Create((int)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + Vector512 result = Vector512.Shuffle(vector, Vector512.Create((int)15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((int)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int64ShuffleOneInputTest() + { + Vector512 vector = Vector512.Create((long)1, 2, 3, 4, 5, 6, 7, 8); + Vector512 result = Vector512.Shuffle(vector, Vector512.Create((long)7, 6, 5, 4, 3, 2, 1, 0)); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((long)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512SByteShuffleOneInputTest() + { + Vector512 vector = Vector512.Create((sbyte)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64); + Vector512 result = Vector512.Shuffle(vector, Vector512.Create((sbyte)63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((sbyte)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512SingleShuffleOneInputTest() + { + Vector512 vector = Vector512.Create((float)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + Vector512 result = Vector512.Shuffle(vector, Vector512.Create((int)15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((float)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt16ShuffleOneInputTest() + { + Vector512 vector = Vector512.Create((ushort)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); + Vector512 result = Vector512.Shuffle(vector, Vector512.Create((ushort)31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ushort)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt32ShuffleOneInputTest() + { + Vector512 vector = Vector512.Create((uint)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + Vector512 result = Vector512.Shuffle(vector, Vector512.Create((uint)15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((uint)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt64ShuffleOneInputTest() + { + Vector512 vector = Vector512.Create((ulong)1, 2, 3, 4, 5, 6, 7, 8); + Vector512 result = Vector512.Shuffle(vector, Vector512.Create((ulong)7, 6, 5, 4, 3, 2, 1, 0)); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ulong)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512ByteShuffleOneInputWithDirectVectorTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((byte)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64), + Vector512.Create((byte)63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) + ); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((byte)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512DoubleShuffleOneInputWithDirectVectorTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((double)1, 2, 3, 4, 5, 6, 7, 8), + Vector512.Create((long)7, 6, 5, 4, 3, 2, 1, 0) + ); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((double)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int16ShuffleOneInputWithDirectVectorTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((short)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32), + Vector512.Create((short)31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) + ); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((short)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int32ShuffleOneInputWithDirectVectorTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((int)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), + Vector512.Create((int)15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) + ); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((int)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int64ShuffleOneInputWithDirectVectorTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((long)1, 2, 3, 4, 5, 6, 7, 8), + Vector512.Create((long)7, 6, 5, 4, 3, 2, 1, 0) + ); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((long)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512SByteShuffleOneInputWithDirectVectorTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((sbyte)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64), + Vector512.Create((sbyte)63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) + ); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((sbyte)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512SingleShuffleOneInputWithDirectVectorTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((float)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), + Vector512.Create((int)15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) + ); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((float)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt16ShuffleOneInputWithDirectVectorTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((ushort)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32), + Vector512.Create((ushort)31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) + ); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ushort)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt32ShuffleOneInputWithDirectVectorTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((uint)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), + Vector512.Create((uint)15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) + ); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((uint)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt64ShuffleOneInputWithDirectVectorTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((ulong)1, 2, 3, 4, 5, 6, 7, 8), + Vector512.Create((ulong)7, 6, 5, 4, 3, 2, 1, 0) + ); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ulong)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512ByteShuffleOneInputWithDirectVectorAndNoCross128BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((byte)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64), + Vector512.Create((byte)15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48) + ); + + for (int index = 0; index < Vector128.Count; index++) + { + Assert.Equal((byte)(Vector128.Count - index), result.GetElement(index)); + } + + for (int index = Vector128.Count; index < Vector256.Count; index++) + { + Assert.Equal((byte)(Vector256.Count - (index - Vector128.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count - Vector128.Count; index++) + { + Assert.Equal((byte)(Vector512.Count - Vector128.Count - (index - Vector256.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count + Vector128.Count; index < Vector512.Count; index++) + { + Assert.Equal((byte)(Vector512.Count - (index - Vector256.Count - Vector128.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512DoubleShuffleOneInputWithDirectVectorAndNoCross128BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((double)1, 2, 3, 4, 5, 6, 7, 8), + Vector512.Create((long)1, 0, 3, 2, 5, 4, 7, 6) + ); + + for (int index = 0; index < Vector128.Count; index++) + { + Assert.Equal((double)(Vector128.Count - index), result.GetElement(index)); + } + + for (int index = Vector128.Count; index < Vector256.Count; index++) + { + Assert.Equal((double)(Vector256.Count - (index - Vector128.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count - Vector128.Count; index++) + { + Assert.Equal((double)(Vector512.Count - Vector128.Count - (index - Vector256.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count + Vector128.Count; index < Vector512.Count; index++) + { + Assert.Equal((double)(Vector512.Count - (index - Vector256.Count - Vector128.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int16ShuffleOneInputWithDirectVectorAndNoCross128BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((short)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32), + Vector512.Create((short)7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8, 23, 22, 21, 20, 19, 18, 17, 16, 31, 30, 29, 28, 27, 26, 25, 24) + ); + + for (int index = 0; index < Vector128.Count; index++) + { + Assert.Equal((short)(Vector128.Count - index), result.GetElement(index)); + } + + for (int index = Vector128.Count; index < Vector256.Count; index++) + { + Assert.Equal((short)(Vector256.Count - (index - Vector128.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count - Vector128.Count; index++) + { + Assert.Equal((short)(Vector512.Count - Vector128.Count - (index - Vector256.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count + Vector128.Count; index < Vector512.Count; index++) + { + Assert.Equal((short)(Vector512.Count - (index - Vector256.Count - Vector128.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int32ShuffleOneInputWithDirectVectorAndNoCross128BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((int)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), + Vector512.Create((int)3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12) + ); + + for (int index = 0; index < Vector128.Count; index++) + { + Assert.Equal((int)(Vector128.Count - index), result.GetElement(index)); + } + + for (int index = Vector128.Count; index < Vector256.Count; index++) + { + Assert.Equal((int)(Vector256.Count - (index - Vector128.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count - Vector128.Count; index++) + { + Assert.Equal((int)(Vector512.Count - Vector128.Count - (index - Vector256.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count + Vector128.Count; index < Vector512.Count; index++) + { + Assert.Equal((int)(Vector512.Count - (index - Vector256.Count - Vector128.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int64ShuffleOneInputWithDirectVectorAndNoCross128BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((long)1, 2, 3, 4, 5, 6, 7, 8), + Vector512.Create((long)1, 0, 3, 2, 5, 4, 7, 6) + ); + + for (int index = 0; index < Vector128.Count; index++) + { + Assert.Equal((long)(Vector128.Count - index), result.GetElement(index)); + } + + for (int index = Vector128.Count; index < Vector256.Count; index++) + { + Assert.Equal((long)(Vector256.Count - (index - Vector128.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count - Vector128.Count; index++) + { + Assert.Equal((long)(Vector512.Count - Vector128.Count - (index - Vector256.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count + Vector128.Count; index < Vector512.Count; index++) + { + Assert.Equal((long)(Vector512.Count - (index - Vector256.Count - Vector128.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512SByteShuffleOneInputWithDirectVectorAndNoCross128BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((sbyte)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64), + Vector512.Create((sbyte)15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48) + ); + + for (int index = 0; index < Vector128.Count; index++) + { + Assert.Equal((sbyte)(Vector128.Count - index), result.GetElement(index)); + } + + for (int index = Vector128.Count; index < Vector256.Count; index++) + { + Assert.Equal((sbyte)(Vector256.Count - (index - Vector128.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count - Vector128.Count; index++) + { + Assert.Equal((sbyte)(Vector512.Count - Vector128.Count - (index - Vector256.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count + Vector128.Count; index < Vector512.Count; index++) + { + Assert.Equal((sbyte)(Vector512.Count - (index - Vector256.Count - Vector128.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512SingleShuffleOneInputWithDirectVectorAndNoCross128BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((float)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), + Vector512.Create((int)3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12) + ); + + for (int index = 0; index < Vector128.Count; index++) + { + Assert.Equal((float)(Vector128.Count - index), result.GetElement(index)); + } + + for (int index = Vector128.Count; index < Vector256.Count; index++) + { + Assert.Equal((float)(Vector256.Count - (index - Vector128.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count - Vector128.Count; index++) + { + Assert.Equal((float)(Vector512.Count - Vector128.Count - (index - Vector256.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count + Vector128.Count; index < Vector512.Count; index++) + { + Assert.Equal((float)(Vector512.Count - (index - Vector256.Count - Vector128.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt16ShuffleOneInputWithDirectVectorAndNoCross128BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((ushort)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32), + Vector512.Create((ushort)7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8, 23, 22, 21, 20, 19, 18, 17, 16, 31, 30, 29, 28, 27, 26, 25, 24) + ); + + for (int index = 0; index < Vector128.Count; index++) + { + Assert.Equal((ushort)(Vector128.Count - index), result.GetElement(index)); + } + + for (int index = Vector128.Count; index < Vector256.Count; index++) + { + Assert.Equal((ushort)(Vector256.Count - (index - Vector128.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count - Vector128.Count; index++) + { + Assert.Equal((ushort)(Vector512.Count - Vector128.Count - (index - Vector256.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count + Vector128.Count; index < Vector512.Count; index++) + { + Assert.Equal((ushort)(Vector512.Count - (index - Vector256.Count - Vector128.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt32ShuffleOneInputWithDirectVectorAndNoCross128BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((uint)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), + Vector512.Create((uint)3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12) + ); + + for (int index = 0; index < Vector128.Count; index++) + { + Assert.Equal((uint)(Vector128.Count - index), result.GetElement(index)); + } + + for (int index = Vector128.Count; index < Vector256.Count; index++) + { + Assert.Equal((uint)(Vector256.Count - (index - Vector128.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count - Vector128.Count; index++) + { + Assert.Equal((uint)(Vector512.Count - Vector128.Count - (index - Vector256.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count + Vector128.Count; index < Vector512.Count; index++) + { + Assert.Equal((uint)(Vector512.Count - (index - Vector256.Count - Vector128.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt64ShuffleOneInputWithDirectVectorAndNoCross128BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((ulong)1, 2, 3, 4, 5, 6, 7, 8), + Vector512.Create((ulong)1, 0, 3, 2, 5, 4, 7, 6) + ); + + for (int index = 0; index < Vector128.Count; index++) + { + Assert.Equal((ulong)(Vector128.Count - index), result.GetElement(index)); + } + + for (int index = Vector128.Count; index < Vector256.Count; index++) + { + Assert.Equal((ulong)(Vector256.Count - (index - Vector128.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count - Vector128.Count; index++) + { + Assert.Equal((ulong)(Vector512.Count - Vector128.Count - (index - Vector256.Count)), result.GetElement(index)); + } + + for (int index = Vector256.Count + Vector128.Count; index < Vector512.Count; index++) + { + Assert.Equal((ulong)(Vector512.Count - (index - Vector256.Count - Vector128.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512ByteShuffleOneInputWithDirectVectorAndNoCross256BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((byte)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64), + Vector512.Create((byte)31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32) + ); + + for (int index = 0; index < Vector256.Count; index++) + { + Assert.Equal((byte)(Vector256.Count - index), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count; index++) + { + Assert.Equal((byte)(Vector512.Count - (index - Vector256.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512DoubleShuffleOneInputWithDirectVectorAndNoCross256BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((double)1, 2, 3, 4, 5, 6, 7, 8), + Vector512.Create((long)3, 2, 1, 0, 7, 6, 5, 4) + ); + + for (int index = 0; index < Vector256.Count; index++) + { + Assert.Equal((double)(Vector256.Count - index), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count; index++) + { + Assert.Equal((double)(Vector512.Count - (index - Vector256.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int16ShuffleOneInputWithDirectVectorAndNoCross256BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((short)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32), + Vector512.Create((short)15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16) + ); + + for (int index = 0; index < Vector256.Count; index++) + { + Assert.Equal((short)(Vector256.Count - index), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count; index++) + { + Assert.Equal((short)(Vector512.Count - (index - Vector256.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int32ShuffleOneInputWithDirectVectorAndNoCross256BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((int)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), + Vector512.Create((int)7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8) + ); + + for (int index = 0; index < Vector256.Count; index++) + { + Assert.Equal((int)(Vector256.Count - index), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count; index++) + { + Assert.Equal((int)(Vector512.Count - (index - Vector256.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int64ShuffleOneInputWithDirectVectorAndNoCross256BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((long)1, 2, 3, 4, 5, 6, 7, 8), + Vector512.Create((long)3, 2, 1, 0, 7, 6, 5, 4) + ); + + for (int index = 0; index < Vector256.Count; index++) + { + Assert.Equal((long)(Vector256.Count - index), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count; index++) + { + Assert.Equal((long)(Vector512.Count - (index - Vector256.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512SByteShuffleOneInputWithDirectVectorAndNoCross256BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((sbyte)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64), + Vector512.Create((sbyte)31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32) + ); + + for (int index = 0; index < Vector256.Count; index++) + { + Assert.Equal((sbyte)(Vector256.Count - index), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count; index++) + { + Assert.Equal((sbyte)(Vector512.Count - (index - Vector256.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512SingleShuffleOneInputWithDirectVectorAndNoCross256BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((float)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), + Vector512.Create((int)7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8) + ); + + for (int index = 0; index < Vector256.Count; index++) + { + Assert.Equal((float)(Vector256.Count - index), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count; index++) + { + Assert.Equal((float)(Vector512.Count - (index - Vector256.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt16ShuffleOneInputWithDirectVectorAndNoCross256BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((ushort)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32), + Vector512.Create((ushort)15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16) + ); + + for (int index = 0; index < Vector256.Count; index++) + { + Assert.Equal((ushort)(Vector256.Count - index), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count; index++) + { + Assert.Equal((ushort)(Vector512.Count - (index - Vector256.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt32ShuffleOneInputWithDirectVectorAndNoCross256BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((uint)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), + Vector512.Create((uint)7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8) + ); + + for (int index = 0; index < Vector256.Count; index++) + { + Assert.Equal((uint)(Vector256.Count - index), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count; index++) + { + Assert.Equal((uint)(Vector512.Count - (index - Vector256.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt64ShuffleOneInputWithDirectVectorAndNoCross256BitLaneTest() + { + Vector512 result = Vector512.Shuffle( + Vector512.Create((ulong)1, 2, 3, 4, 5, 6, 7, 8), + Vector512.Create((ulong)3, 2, 1, 0, 7, 6, 5, 4) + ); + + for (int index = 0; index < Vector256.Count; index++) + { + Assert.Equal((ulong)(Vector256.Count - index), result.GetElement(index)); + } + + for (int index = Vector256.Count; index < Vector512.Count; index++) + { + Assert.Equal((ulong)(Vector512.Count - (index - Vector256.Count)), result.GetElement(index)); + } + } + + [Fact] + public void Vector512ByteShuffleOneInputWithLocalIndicesTest() + { + Vector512 vector = Vector512.Create((byte)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64); + Vector512 indices = Vector512.Create((byte)63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); + Vector512 result = Vector512.Shuffle(vector, indices); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((byte)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512DoubleShuffleOneInputWithLocalIndicesTest() + { + Vector512 vector = Vector512.Create((double)1, 2, 3, 4, 5, 6, 7, 8); + Vector512 indices = Vector512.Create((long)7, 6, 5, 4, 3, 2, 1, 0); + Vector512 result = Vector512.Shuffle(vector, indices); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((double)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int16ShuffleOneInputWithLocalIndicesTest() + { + Vector512 vector = Vector512.Create((short)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); + Vector512 indices = Vector512.Create((short)31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); + Vector512 result = Vector512.Shuffle(vector, indices); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((short)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int32ShuffleOneInputWithLocalIndicesTest() + { + Vector512 vector = Vector512.Create((int)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + Vector512 indices = Vector512.Create((int)15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); + Vector512 result = Vector512.Shuffle(vector, indices); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((int)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int64ShuffleOneInputWithLocalIndicesTest() + { + Vector512 vector = Vector512.Create((long)1, 2, 3, 4, 5, 6, 7, 8); + Vector512 indices = Vector512.Create((long)7, 6, 5, 4, 3, 2, 1, 0); + Vector512 result = Vector512.Shuffle(vector, indices); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((long)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512SByteShuffleOneInputWithLocalIndicesTest() + { + Vector512 vector = Vector512.Create((sbyte)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64); + Vector512 indices = Vector512.Create((sbyte)63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); + Vector512 result = Vector512.Shuffle(vector, indices); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((sbyte)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512SingleShuffleOneInputWithLocalIndicesTest() + { + Vector512 vector = Vector512.Create((float)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + Vector512 indices = Vector512.Create((int)15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); + Vector512 result = Vector512.Shuffle(vector, indices); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((float)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt16ShuffleOneInputWithLocalIndicesTest() + { + Vector512 vector = Vector512.Create((ushort)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); + Vector512 indices = Vector512.Create((ushort)31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); + Vector512 result = Vector512.Shuffle(vector, indices); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ushort)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt32ShuffleOneInputWithLocalIndicesTest() + { + Vector512 vector = Vector512.Create((uint)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + Vector512 indices = Vector512.Create((uint)15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); + Vector512 result = Vector512.Shuffle(vector, indices); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((uint)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt64ShuffleOneInputWithLocalIndicesTest() + { + Vector512 vector = Vector512.Create((ulong)1, 2, 3, 4, 5, 6, 7, 8); + Vector512 indices = Vector512.Create((ulong)7, 6, 5, 4, 3, 2, 1, 0); + Vector512 result = Vector512.Shuffle(vector, indices); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ulong)(Vector512.Count - index), result.GetElement(index)); + } + } + + [Fact] + public void Vector512ByteShuffleOneInputWithAllBitsSetIndicesTest() + { + Vector512 vector = Vector512.Create((byte)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64); + Vector512 result = Vector512.Shuffle(vector, Vector512.AllBitsSet); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((byte)0, result.GetElement(index)); + } + } + + [Fact] + public void Vector512DoubleShuffleOneInputWithAllBitsSetIndicesTest() + { + Vector512 vector = Vector512.Create((double)1, 2, 3, 4, 5, 6, 7, 8); + Vector512 result = Vector512.Shuffle(vector, Vector512.AllBitsSet); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((double)0, result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int16ShuffleOneInputWithAllBitsSetIndicesTest() + { + Vector512 vector = Vector512.Create((short)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); + Vector512 result = Vector512.Shuffle(vector, Vector512.AllBitsSet); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((short)0, result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int32ShuffleOneInputWithAllBitsSetIndicesTest() + { + Vector512 vector = Vector512.Create((int)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + Vector512 result = Vector512.Shuffle(vector, Vector512.AllBitsSet); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((int)0, result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int64ShuffleOneInputWithAllBitsSetIndicesTest() + { + Vector512 vector = Vector512.Create((long)1, 2, 3, 4, 5, 6, 7, 8); + Vector512 result = Vector512.Shuffle(vector, Vector512.AllBitsSet); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((long)0, result.GetElement(index)); + } + } + + [Fact] + public void Vector512SByteShuffleOneInputWithAllBitsSetIndicesTest() + { + Vector512 vector = Vector512.Create((sbyte)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64); + Vector512 result = Vector512.Shuffle(vector, Vector512.AllBitsSet); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((sbyte)0, result.GetElement(index)); + } + } + + [Fact] + public void Vector512SingleShuffleOneInputWithAllBitsSetIndicesTest() + { + Vector512 vector = Vector512.Create((float)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + Vector512 result = Vector512.Shuffle(vector, Vector512.AllBitsSet); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((float)0, result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt16ShuffleOneInputWithAllBitsSetIndicesTest() + { + Vector512 vector = Vector512.Create((ushort)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); + Vector512 result = Vector512.Shuffle(vector, Vector512.AllBitsSet); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ushort)0, result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt32ShuffleOneInputWithAllBitsSetIndicesTest() + { + Vector512 vector = Vector512.Create((uint)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + Vector512 result = Vector512.Shuffle(vector, Vector512.AllBitsSet); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((uint)0, result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt64ShuffleOneInputWithAllBitsSetIndicesTest() + { + Vector512 vector = Vector512.Create((ulong)1, 2, 3, 4, 5, 6, 7, 8); + Vector512 result = Vector512.Shuffle(vector, Vector512.AllBitsSet); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ulong)0, result.GetElement(index)); + } + } + + [Fact] + public void Vector512ByteShuffleOneInputWithZeroIndicesTest() + { + Vector512 vector = Vector512.Create((byte)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64); + Vector512 result = Vector512.Shuffle(vector, Vector512.Zero); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((byte)1, result.GetElement(index)); + } + } + + [Fact] + public void Vector512DoubleShuffleOneInputWithZeroIndicesTest() + { + Vector512 vector = Vector512.Create((double)1, 2, 3, 4, 5, 6, 7, 8); + Vector512 result = Vector512.Shuffle(vector, Vector512.Zero); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((double)1, result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int16ShuffleOneInputWithZeroIndicesTest() + { + Vector512 vector = Vector512.Create((short)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); + Vector512 result = Vector512.Shuffle(vector, Vector512.Zero); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((short)1, result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int32ShuffleOneInputWithZeroIndicesTest() + { + Vector512 vector = Vector512.Create((int)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + Vector512 result = Vector512.Shuffle(vector, Vector512.Zero); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((int)1, result.GetElement(index)); + } + } + + [Fact] + public void Vector512Int64ShuffleOneInputWithZeroIndicesTest() + { + Vector512 vector = Vector512.Create((long)1, 2, 3, 4, 5, 6, 7, 8); + Vector512 result = Vector512.Shuffle(vector, Vector512.Zero); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((long)1, result.GetElement(index)); + } + } + + [Fact] + public void Vector512SByteShuffleOneInputWithZeroIndicesTest() + { + Vector512 vector = Vector512.Create((sbyte)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64); + Vector512 result = Vector512.Shuffle(vector, Vector512.Zero); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((sbyte)1, result.GetElement(index)); + } + } + + [Fact] + public void Vector512SingleShuffleOneInputWithZeroIndicesTest() + { + Vector512 vector = Vector512.Create((float)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + Vector512 result = Vector512.Shuffle(vector, Vector512.Zero); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((float)1, result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt16ShuffleOneInputWithZeroIndicesTest() + { + Vector512 vector = Vector512.Create((ushort)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); + Vector512 result = Vector512.Shuffle(vector, Vector512.Zero); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ushort)1, result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt32ShuffleOneInputWithZeroIndicesTest() + { + Vector512 vector = Vector512.Create((uint)1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + Vector512 result = Vector512.Shuffle(vector, Vector512.Zero); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((uint)1, result.GetElement(index)); + } + } + + [Fact] + public void Vector512UInt64ShuffleOneInputWithZeroIndicesTest() + { + Vector512 vector = Vector512.Create((ulong)1, 2, 3, 4, 5, 6, 7, 8); + Vector512 result = Vector512.Shuffle(vector, Vector512.Zero); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ulong)1, result.GetElement(index)); + } + } + + [Fact] + public unsafe void Vector512ByteStoreTest() + { + byte* value = stackalloc byte[64]; + + for (int index = 0; index < 64; index++) + { + value[index] = (byte)(index); + } + + Vector512.Create((byte)0x1).Store(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((byte)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512DoubleStoreTest() + { + double* value = stackalloc double[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512.Create((double)0x1).Store(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((double)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512Int16StoreTest() + { + short* value = stackalloc short[32]; + + for (int index = 0; index < 32; index++) + { + value[index] = (short)(index); + } + + Vector512.Create((short)0x1).Store(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((short)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512Int32StoreTest() + { + int* value = stackalloc int[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512.Create((int)0x1).Store(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((int)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512Int64StoreTest() + { + long* value = stackalloc long[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512.Create((long)0x1).Store(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((long)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512NIntStoreTest() + { + if (Environment.Is64BitProcess) + { + nint* value = stackalloc nint[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512.Create((nint)0x1).Store(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nint)0x1, value[index]); + } + } + else + { + nint* value = stackalloc nint[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512.Create((nint)0x1).Store(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nint)0x1, value[index]); + } + } + } + + [Fact] + public unsafe void Vector512NUIntStoreTest() + { + if (Environment.Is64BitProcess) + { + nuint* value = stackalloc nuint[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = (nuint)(index); + } + + Vector512.Create((nuint)0x1).Store(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nuint)0x1, value[index]); + } + } + else + { + nuint* value = stackalloc nuint[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = (nuint)(index); + } + + Vector512.Create((nuint)0x1).Store(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nuint)0x1, value[index]); + } + } + } + + [Fact] + public unsafe void Vector512SByteStoreTest() + { + sbyte* value = stackalloc sbyte[64]; + + for (int index = 0; index < 64; index++) + { + value[index] = (sbyte)(index); + } + + Vector512.Create((sbyte)0x1).Store(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((sbyte)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512SingleStoreTest() + { + float* value = stackalloc float[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512.Create((float)0x1).Store(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((float)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512UInt16StoreTest() + { + ushort* value = stackalloc ushort[32]; + + for (int index = 0; index < 32; index++) + { + value[index] = (ushort)(index); + } + + Vector512.Create((ushort)0x1).Store(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ushort)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512UInt32StoreTest() + { + uint* value = stackalloc uint[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = (uint)(index); + } + + Vector512.Create((uint)0x1).Store(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((uint)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512UInt64StoreTest() + { + ulong* value = stackalloc ulong[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = (ulong)(index); + } + + Vector512.Create((ulong)0x1).Store(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ulong)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512ByteStoreAlignedTest() + { + byte* value = null; + + try + { + value = (byte*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 64; index++) + { + value[index] = (byte)(index); + } + + Vector512.Create((byte)0x1).StoreAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((byte)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512DoubleStoreAlignedTest() + { + double* value = null; + + try + { + value = (double*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512.Create((double)0x1).StoreAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((double)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512Int16StoreAlignedTest() + { + short* value = null; + + try + { + value = (short*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 32; index++) + { + value[index] = (short)(index); + } + + Vector512.Create((short)0x1).StoreAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((short)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512Int32StoreAlignedTest() + { + int* value = null; + + try + { + value = (int*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512.Create((int)0x1).StoreAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((int)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512Int64StoreAlignedTest() + { + long* value = null; + + try + { + value = (long*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512.Create((long)0x1).StoreAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((long)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512NIntStoreAlignedTest() + { + nint* value = null; + + try + { + value = (nint*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + if (Environment.Is64BitProcess) + { + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + } + else + { + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + } + + Vector512.Create((nint)0x1).StoreAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nint)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512NUIntStoreAlignedTest() + { + nuint* value = null; + + try + { + value = (nuint*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + if (Environment.Is64BitProcess) + { + for (int index = 0; index < 8; index++) + { + value[index] = (nuint)(index); + } + } + else + { + for (int index = 0; index < 16; index++) + { + value[index] = (nuint)(index); + } + } + + Vector512.Create((nuint)0x1).StoreAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nuint)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512SByteStoreAlignedTest() + { + sbyte* value = null; + + try + { + value = (sbyte*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 64; index++) + { + value[index] = (sbyte)(index); + } + + Vector512.Create((sbyte)0x1).StoreAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((sbyte)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512SingleStoreAlignedTest() + { + float* value = null; + + try + { + value = (float*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512.Create((float)0x1).StoreAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((float)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512UInt16StoreAlignedTest() + { + ushort* value = null; + + try + { + value = (ushort*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 32; index++) + { + value[index] = (ushort)(index); + } + + Vector512.Create((ushort)0x1).StoreAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ushort)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512UInt32StoreAlignedTest() + { + uint* value = null; + + try + { + value = (uint*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 16; index++) + { + value[index] = (uint)(index); + } + + Vector512.Create((uint)0x1).StoreAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((uint)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512UInt64StoreAlignedTest() + { + ulong* value = null; + + try + { + value = (ulong*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 8; index++) + { + value[index] = (ulong)(index); + } + + Vector512.Create((ulong)0x1).StoreAligned(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ulong)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512ByteStoreAlignedNonTemporalTest() + { + byte* value = null; + + try + { + value = (byte*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 64; index++) + { + value[index] = (byte)(index); + } + + Vector512.Create((byte)0x1).StoreAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((byte)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512DoubleStoreAlignedNonTemporalTest() + { + double* value = null; + + try + { + value = (double*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512.Create((double)0x1).StoreAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((double)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512Int16StoreAlignedNonTemporalTest() + { + short* value = null; + + try + { + value = (short*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 32; index++) + { + value[index] = (short)(index); + } + + Vector512.Create((short)0x1).StoreAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((short)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512Int32StoreAlignedNonTemporalTest() + { + int* value = null; + + try + { + value = (int*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512.Create((int)0x1).StoreAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((int)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512Int64StoreAlignedNonTemporalTest() + { + long* value = null; + + try + { + value = (long*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512.Create((long)0x1).StoreAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((long)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512NIntStoreAlignedNonTemporalTest() + { + nint* value = null; + + try + { + value = (nint*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + if (Environment.Is64BitProcess) + { + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + } + else + { + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + } + + Vector512.Create((nint)0x1).StoreAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nint)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512NUIntStoreAlignedNonTemporalTest() + { + nuint* value = null; + + try + { + value = (nuint*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + if (Environment.Is64BitProcess) + { + for (int index = 0; index < 8; index++) + { + value[index] = (nuint)(index); + } + } + else + { + for (int index = 0; index < 16; index++) + { + value[index] = (nuint)(index); + } + } + + Vector512.Create((nuint)0x1).StoreAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nuint)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512SByteStoreAlignedNonTemporalTest() + { + sbyte* value = null; + + try + { + value = (sbyte*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 64; index++) + { + value[index] = (sbyte)(index); + } + + Vector512.Create((sbyte)0x1).StoreAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((sbyte)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512SingleStoreAlignedNonTemporalTest() + { + float* value = null; + + try + { + value = (float*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512.Create((float)0x1).StoreAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((float)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512UInt16StoreAlignedNonTemporalTest() + { + ushort* value = null; + + try + { + value = (ushort*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 32; index++) + { + value[index] = (ushort)(index); + } + + Vector512.Create((ushort)0x1).StoreAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ushort)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512UInt32StoreAlignedNonTemporalTest() + { + uint* value = null; + + try + { + value = (uint*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 16; index++) + { + value[index] = (uint)(index); + } + + Vector512.Create((uint)0x1).StoreAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((uint)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512UInt64StoreAlignedNonTemporalTest() + { + ulong* value = null; + + try + { + value = (ulong*)NativeMemory.AlignedAlloc(byteCount: 64, alignment: 64); + + for (int index = 0; index < 8; index++) + { + value[index] = (ulong)(index); + } + + Vector512.Create((ulong)0x1).StoreAlignedNonTemporal(value); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ulong)0x1, value[index]); + } + } + finally + { + NativeMemory.AlignedFree(value); + } + } + + [Fact] + public unsafe void Vector512ByteStoreUnsafeTest() + { + byte* value = stackalloc byte[64]; + + for (int index = 0; index < 64; index++) + { + value[index] = (byte)(index); + } + + Vector512.Create((byte)0x1).StoreUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((byte)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512DoubleStoreUnsafeTest() + { + double* value = stackalloc double[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512.Create((double)0x1).StoreUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((double)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512Int16StoreUnsafeTest() + { + short* value = stackalloc short[32]; + + for (int index = 0; index < 32; index++) + { + value[index] = (short)(index); + } + + Vector512.Create((short)0x1).StoreUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((short)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512Int32StoreUnsafeTest() + { + int* value = stackalloc int[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512.Create((int)0x1).StoreUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((int)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512Int64StoreUnsafeTest() + { + long* value = stackalloc long[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512.Create((long)0x1).StoreUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((long)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512NIntStoreUnsafeTest() + { + if (Environment.Is64BitProcess) + { + nint* value = stackalloc nint[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = index; + } + + Vector512.Create((nint)0x1).StoreUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nint)0x1, value[index]); + } + } + else + { + nint* value = stackalloc nint[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512.Create((nint)0x1).StoreUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nint)0x1, value[index]); + } + } + } + + [Fact] + public unsafe void Vector512NUIntStoreUnsafeTest() + { + if (Environment.Is64BitProcess) + { + nuint* value = stackalloc nuint[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = (nuint)(index); + } + + Vector512.Create((nuint)0x1).StoreUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nuint)0x1, value[index]); + } + } + else + { + nuint* value = stackalloc nuint[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = (nuint)(index); + } + + Vector512.Create((nuint)0x1).StoreUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nuint)0x1, value[index]); + } + } + } + + [Fact] + public unsafe void Vector512SByteStoreUnsafeTest() + { + sbyte* value = stackalloc sbyte[64]; + + for (int index = 0; index < 64; index++) + { + value[index] = (sbyte)(index); + } + + Vector512.Create((sbyte)0x1).StoreUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((sbyte)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512SingleStoreUnsafeTest() + { + float* value = stackalloc float[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = index; + } + + Vector512.Create((float)0x1).StoreUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((float)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512UInt16StoreUnsafeTest() + { + ushort* value = stackalloc ushort[32]; + + for (int index = 0; index < 32; index++) + { + value[index] = (ushort)(index); + } + + Vector512.Create((ushort)0x1).StoreUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ushort)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512UInt32StoreUnsafeTest() + { + uint* value = stackalloc uint[16]; + + for (int index = 0; index < 16; index++) + { + value[index] = (uint)(index); + } + + Vector512.Create((uint)0x1).StoreUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((uint)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512UInt64StoreUnsafeTest() + { + ulong* value = stackalloc ulong[8]; + + for (int index = 0; index < 8; index++) + { + value[index] = (ulong)(index); + } + + Vector512.Create((ulong)0x1).StoreUnsafe(ref value[0]); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ulong)0x1, value[index]); + } + } + + [Fact] + public unsafe void Vector512ByteStoreUnsafeIndexTest() + { + byte* value = stackalloc byte[64 + 1]; + + for (int index = 0; index < 64 + 1; index++) + { + value[index] = (byte)(index); + } + + Vector512.Create((byte)0x1).StoreUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((byte)0x1, value[index + 1]); + } + } + + [Fact] + public unsafe void Vector512DoubleStoreUnsafeIndexTest() + { + double* value = stackalloc double[8 + 1]; + + for (int index = 0; index < 8 + 1; index++) + { + value[index] = index; + } + + Vector512.Create((double)0x1).StoreUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((double)0x1, value[index + 1]); + } + } + + [Fact] + public unsafe void Vector512Int16StoreUnsafeIndexTest() + { + short* value = stackalloc short[32 + 1]; + + for (int index = 0; index < 32 + 1; index++) + { + value[index] = (short)(index); + } + + Vector512.Create((short)0x1).StoreUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((short)0x1, value[index + 1]); + } + } + + [Fact] + public unsafe void Vector512Int32StoreUnsafeIndexTest() + { + int* value = stackalloc int[16 + 1]; + + for (int index = 0; index < 16 + 1; index++) + { + value[index] = index; + } + + Vector512.Create((int)0x1).StoreUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((int)0x1, value[index + 1]); + } + } + + [Fact] + public unsafe void Vector512Int64StoreUnsafeIndexTest() + { + long* value = stackalloc long[8 + 1]; + + for (int index = 0; index < 8 + 1; index++) + { + value[index] = index; + } + + Vector512.Create((long)0x1).StoreUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((long)0x1, value[index + 1]); + } + } + + [Fact] + public unsafe void Vector512NIntStoreUnsafeIndexTest() + { + if (Environment.Is64BitProcess) + { + nint* value = stackalloc nint[8 + 1]; + + for (int index = 0; index < 8 + 1; index++) + { + value[index] = index; + } + + Vector512.Create((nint)0x1).StoreUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nint)0x1, value[index + 1]); + } + } + else + { + nint* value = stackalloc nint[16 + 1]; + + for (int index = 0; index < 16 + 1; index++) + { + value[index] = index; + } + + Vector512.Create((nint)0x1).StoreUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nint)0x1, value[index + 1]); + } + } + } + + [Fact] + public unsafe void Vector512NUIntStoreUnsafeIndexTest() + { + if (Environment.Is64BitProcess) + { + nuint* value = stackalloc nuint[8 + 1]; + + for (int index = 0; index < 8 + 1; index++) + { + value[index] = (nuint)(index); + } + + Vector512.Create((nuint)0x1).StoreUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nuint)0x1, value[index + 1]); + } + } + else + { + nuint* value = stackalloc nuint[16 + 1]; + + for (int index = 0; index < 16 + 1; index++) + { + value[index] = (nuint)(index); + } + + Vector512.Create((nuint)0x1).StoreUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((nuint)0x1, value[index + 1]); + } + } + } + + [Fact] + public unsafe void Vector512SByteStoreUnsafeIndexTest() + { + sbyte* value = stackalloc sbyte[64 + 1]; + + for (int index = 0; index < 64 + 1; index++) + { + value[index] = (sbyte)(index); + } + + Vector512.Create((sbyte)0x1).StoreUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((sbyte)0x1, value[index + 1]); + } + } + + [Fact] + public unsafe void Vector512SingleStoreUnsafeIndexTest() + { + float* value = stackalloc float[16 + 1]; + + for (int index = 0; index < 16 + 1; index++) + { + value[index] = index; + } + + Vector512.Create((float)0x1).StoreUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((float)0x1, value[index + 1]); + } + } + + [Fact] + public unsafe void Vector512UInt16StoreUnsafeIndexTest() + { + ushort* value = stackalloc ushort[32 + 1]; + + for (int index = 0; index < 32 + 1; index++) + { + value[index] = (ushort)(index); + } + + Vector512.Create((ushort)0x1).StoreUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ushort)0x1, value[index + 1]); + } + } + + [Fact] + public unsafe void Vector512UInt32StoreUnsafeIndexTest() + { + uint* value = stackalloc uint[16 + 1]; + + for (int index = 0; index < 16 + 1; index++) + { + value[index] = (uint)(index); + } + + Vector512.Create((uint)0x1).StoreUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((uint)0x1, value[index + 1]); + } + } + + [Fact] + public unsafe void Vector512UInt64StoreUnsafeIndexTest() + { + ulong* value = stackalloc ulong[8 + 1]; + + for (int index = 0; index < 8 + 1; index++) + { + value[index] = (ulong)(index); + } + + Vector512.Create((ulong)0x1).StoreUnsafe(ref value[0], 1); + + for (int index = 0; index < Vector512.Count; index++) + { + Assert.Equal((ulong)0x1, value[index + 1]); + } + } + + [Fact] + public void Vector512ByteSumTest() + { + Vector512 vector = Vector512.Create((byte)0x01); + Assert.Equal((byte)64, Vector512.Sum(vector)); + } + + [Fact] + public void Vector512DoubleSumTest() + { + Vector512 vector = Vector512.Create((double)0x01); + Assert.Equal(8.0, Vector512.Sum(vector)); + } + + [Fact] + public void Vector512Int16SumTest() + { + Vector512 vector = Vector512.Create((short)0x01); + Assert.Equal((short)32, Vector512.Sum(vector)); + } + + [Fact] + public void Vector512Int32SumTest() + { + Vector512 vector = Vector512.Create((int)0x01); + Assert.Equal((int)16, Vector512.Sum(vector)); + } + + [Fact] + public void Vector512Int64SumTest() + { + Vector512 vector = Vector512.Create((long)0x01); + Assert.Equal((long)8, Vector512.Sum(vector)); + } + + [Fact] + public void Vector512NIntSumTest() + { + Vector512 vector = Vector512.Create((nint)0x01); + + if (Environment.Is64BitProcess) + { + Assert.Equal((nint)8, Vector512.Sum(vector)); + } + else + { + Assert.Equal((nint)16, Vector512.Sum(vector)); + } + } + + [Fact] + public void Vector512NUIntSumTest() + { + Vector512 vector = Vector512.Create((nuint)0x01); + + if (Environment.Is64BitProcess) + { + Assert.Equal((nuint)8, Vector512.Sum(vector)); + } + else + { + Assert.Equal((nuint)16, Vector512.Sum(vector)); + } + } + + [Fact] + public void Vector512SByteSumTest() + { + Vector512 vector = Vector512.Create((sbyte)0x01); + Assert.Equal((sbyte)64, Vector512.Sum(vector)); + } + + [Fact] + public void Vector512SingleSumTest() + { + Vector512 vector = Vector512.Create((float)0x01); + Assert.Equal(16.0f, Vector512.Sum(vector)); + } + + [Fact] + public void Vector512UInt16SumTest() + { + Vector512 vector = Vector512.Create((ushort)0x01); + Assert.Equal((ushort)32, Vector512.Sum(vector)); + } + + [Fact] + public void Vector512UInt32SumTest() + { + Vector512 vector = Vector512.Create((uint)0x01); + Assert.Equal((uint)16, Vector512.Sum(vector)); + } + + [Fact] + public void Vector512UInt64SumTest() + { + Vector512 vector = Vector512.Create((ulong)0x01); + Assert.Equal((ulong)8, Vector512.Sum(vector)); + } + + [Theory] + [InlineData(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)] + [InlineData(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)] + [InlineData(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1)] + [InlineData(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)] + [InlineData(0, 0, 50, 430, -64, 0, int.MaxValue, int.MinValue, 0, 0, 50, 430, -64, 0, int.MaxValue, int.MinValue)] + public void Vector512Int32IndexerTest(params int[] values) + { + var vector = Vector512.Create(values); + + Assert.Equal(vector[0], values[0]); + Assert.Equal(vector[1], values[1]); + Assert.Equal(vector[2], values[2]); + Assert.Equal(vector[3], values[3]); + Assert.Equal(vector[4], values[4]); + Assert.Equal(vector[5], values[5]); + Assert.Equal(vector[6], values[6]); + Assert.Equal(vector[7], values[7]); + } + + [Theory] + [InlineData(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L)] + [InlineData(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L)] + [InlineData(0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L)] + [InlineData(0L, 0L, 50L, 430L, -64L, 0L, long.MaxValue, long.MinValue)] + public void Vector512Int64IndexerTest(params long[] values) + { + var vector = Vector512.Create(values); + + Assert.Equal(vector[0], values[0]); + Assert.Equal(vector[1], values[1]); + Assert.Equal(vector[2], values[2]); + Assert.Equal(vector[3], values[3]); + } + + [Fact] + public void Vector512DoubleEqualsNaNTest() + { + Vector512 nan = Vector512.Create(double.NaN); + Assert.True(nan.Equals(nan)); + } + + [Fact] + public void Vector512SingleEqualsNaNTest() + { + Vector512 nan = Vector512.Create(float.NaN); + Assert.True(nan.Equals(nan)); + } + + [Fact] + public void Vector512DoubleEqualsNonCanonicalNaNTest() + { + // max 8 bit exponent, just under half max mantissa + var snan = BitConverter.UInt64BitsToDouble(0x7FF7_FFFF_FFFF_FFFF); + var nans = new double[] + { + double.CopySign(double.NaN, -0.0), // -qnan same as double.NaN + double.CopySign(double.NaN, +0.0), // +qnan + double.CopySign(snan, -0.0), // -snan + double.CopySign(snan, +0.0), // +snan + }; + + // all Vector NaNs .Equals compare the same, but == compare as different + foreach(var i in nans) + { + foreach(var j in nans) + { + Assert.True(Vector512.Create(i).Equals(Vector512.Create(j))); + Assert.False(Vector512.Create(i) == Vector512.Create(j)); + } + } + } + + [Fact] + public void Vector512SingleEqualsNonCanonicalNaNTest() + { + // max 11 bit exponent, just under half max mantissa + var snan = BitConverter.UInt32BitsToSingle(0x7FBF_FFFF); + var nans = new float[] + { + float.CopySign(float.NaN, -0.0f), // -qnan same as float.NaN + float.CopySign(float.NaN, +0.0f), // +qnan + float.CopySign(snan, -0.0f), // -snan + float.CopySign(snan, +0.0f), // +snan + }; + + // all Vector NaNs .Equals compare the same, but == compare as different + foreach(var i in nans) + { + foreach(var j in nans) + { + Assert.True(Vector512.Create(i).Equals(Vector512.Create(j))); + Assert.False(Vector512.Create(i) == Vector512.Create(j)); + } + } + } + + [Fact] + public void IsSupportedByte() => TestIsSupported(); + + [Fact] + public void IsSupportedDouble() => TestIsSupported(); + + [Fact] + public void IsSupportedInt16() => TestIsSupported(); + + [Fact] + public void IsSupportedInt32() => TestIsSupported(); + + [Fact] + public void IsSupportedInt64() => TestIsSupported(); + + [Fact] + public void IsSupportedIntPtr() => TestIsSupported(); + + [Fact] + public void IsSupportedSByte() => TestIsSupported(); + + [Fact] + public void IsSupportedSingle() => TestIsSupported(); + + [Fact] + public void IsSupportedUInt16() => TestIsSupported(); + + [Fact] + public void IsSupportedUInt32() => TestIsSupported(); + + [Fact] + public void IsSupportedUInt64() => TestIsSupported(); + + [Fact] + public void IsSupportedUIntPtr() => TestIsSupported(); + + private static void TestIsSupported() + where T : struct + { + Assert.True(Vector512.IsSupported); + + MethodInfo methodInfo = typeof(Vector512).GetProperty("IsSupported", BindingFlags.Public | BindingFlags.Static).GetMethod; + Assert.True((bool)methodInfo.Invoke(null, null)); + } + + [Fact] + public void IsNotSupportedBoolean() => TestIsNotSupported(); + + [Fact] + public void IsNotSupportedChar() => TestIsNotSupported(); + + [Fact] + public void IsNotSupportedHalf() => TestIsNotSupported(); + + [Fact] + public void IsNotSupportedInt128() => TestIsNotSupported(); + + [Fact] + public void IsNotSupportedUInt128() => TestIsNotSupported(); + + private static void TestIsNotSupported() + where T : struct + { + Assert.False(Vector512.IsSupported); + + MethodInfo methodInfo = typeof(Vector512).GetProperty("IsSupported", BindingFlags.Public | BindingFlags.Static).GetMethod; + Assert.False((bool)methodInfo.Invoke(null, null)); + } + } +} From 03dd856f35748ffb63498a5c073eebe5a12c1210 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Tue, 4 Oct 2022 15:34:50 -0700 Subject: [PATCH 02/26] Support properly packing Vector512 --- .../Compiler/VectorFieldLayoutAlgorithm.cs | 30 ++++++++++++++++--- .../CodeGen/TargetDetails.CodeGen.cs | 5 ++++ .../Common/TypeSystem/Common/TargetDetails.cs | 12 ++++---- .../TypeSystem/Interop/IL/MarshalHelpers.cs | 2 ++ .../Common/TypeSystem/Interop/InteropTypes.cs | 5 ++++ .../Compiler/VectorOfTFieldLayoutAlgorithm.cs | 4 +++ .../Compiler/ReadyToRunCompilerContext.cs | 2 ++ src/coreclr/vm/classlayoutinfo.cpp | 4 ++- src/coreclr/vm/classnames.h | 3 ++ src/coreclr/vm/corelib.h | 1 + src/coreclr/vm/fieldmarshaler.h | 2 +- src/coreclr/vm/methodtable.cpp | 8 ++--- src/coreclr/vm/methodtablebuilder.cpp | 16 ++++++++++ src/coreclr/vm/mlinfo.cpp | 2 ++ src/mono/mono/mini/mini-llvm.c | 2 +- src/mono/mono/mini/mini-runtime.c | 2 +- src/mono/mono/mini/simd-intrinsics.c | 5 ++-- 17 files changed, 85 insertions(+), 20 deletions(-) diff --git a/src/coreclr/tools/Common/Compiler/VectorFieldLayoutAlgorithm.cs b/src/coreclr/tools/Common/Compiler/VectorFieldLayoutAlgorithm.cs index ae5d8c58c2a9cc..a8770e13851d1f 100644 --- a/src/coreclr/tools/Common/Compiler/VectorFieldLayoutAlgorithm.cs +++ b/src/coreclr/tools/Common/Compiler/VectorFieldLayoutAlgorithm.cs @@ -44,7 +44,7 @@ public override ComputedInstanceFieldLayout ComputeInstanceLayout(DefType defTyp alignment = new LayoutInt(16); } } - else + else if (name == "Vector256`1") { Debug.Assert(name == "Vector256`1"); @@ -65,6 +65,27 @@ public override ComputedInstanceFieldLayout ComputeInstanceLayout(DefType defTyp alignment = new LayoutInt(32); } } + else + { + Debug.Assert(name == "Vector512`1"); + + if (defType.Context.Target.Architecture == TargetArchitecture.ARM) + { + // No such type exists for the Procedure Call Standard for ARM. We will default + // to the same alignment as __m128, which is supported by the ABI. + alignment = new LayoutInt(8); + } + else if (defType.Context.Target.Architecture == TargetArchitecture.ARM64) + { + // The Procedure Call Standard for ARM 64-bit (with SVE support) defaults to + // 16-byte alignment for __m256. + alignment = new LayoutInt(16); + } + else + { + alignment = new LayoutInt(64); + } + } ComputedInstanceFieldLayout layoutFromMetadata = _fallbackAlgorithm.ComputeInstanceLayout(defType, layoutKind); @@ -116,9 +137,10 @@ public static bool IsVectorType(DefType type) { return type.IsIntrinsic && type.Namespace == "System.Runtime.Intrinsics" && - (type.Name == "Vector64`1" || - type.Name == "Vector128`1" || - type.Name == "Vector256`1"); + ((type.Name == "Vector64`1") || + (type.Name == "Vector128`1") || + (type.Name == "Vector256`1") || + (type.Name == "Vector512`1")); } } } diff --git a/src/coreclr/tools/Common/TypeSystem/CodeGen/TargetDetails.CodeGen.cs b/src/coreclr/tools/Common/TypeSystem/CodeGen/TargetDetails.CodeGen.cs index 353399eb78b7fb..d02249f296890e 100644 --- a/src/coreclr/tools/Common/TypeSystem/CodeGen/TargetDetails.CodeGen.cs +++ b/src/coreclr/tools/Common/TypeSystem/CodeGen/TargetDetails.CodeGen.cs @@ -40,5 +40,10 @@ public enum SimdVectorLength /// Specifies that native vectors are 256 bit (e.g. AVX on x86). /// Vector256Bit, + + /// + /// Specifies that native vectors are 512 bit (e.g. AVX512 on x86). + /// + Vector512Bit, } } diff --git a/src/coreclr/tools/Common/TypeSystem/Common/TargetDetails.cs b/src/coreclr/tools/Common/TypeSystem/Common/TargetDetails.cs index 22aa2c0c047fbb..ea395799b6d0c2 100644 --- a/src/coreclr/tools/Common/TypeSystem/Common/TargetDetails.cs +++ b/src/coreclr/tools/Common/TypeSystem/Common/TargetDetails.cs @@ -109,12 +109,12 @@ public int MaximumAlignment { if (Architecture == TargetArchitecture.ARM) { - // Corresponds to alignment required for __m128 (there's no __m256) + // Corresponds to alignment required for __m128 (there's no __m256/__m512) return 8; } else if (Architecture == TargetArchitecture.ARM64) { - // Corresponds to alignmet required for __m256 + // Corresponds to alignmet required for __m128 (there's no __m256/__m512) return 16; } else if (Architecture == TargetArchitecture.LoongArch64) @@ -122,8 +122,8 @@ public int MaximumAlignment return 16; } - // 256-bit vector is the type with the highest alignment we support - return 32; + // 512-bit vector is the type with the highest alignment we support + return 64; } } @@ -136,8 +136,8 @@ public int DefaultPackingSize { get { - // We use default packing size of 32 irrespective of the platform. - return 32; + // We use default packing size of 64 irrespective of the platform. + return 64; } } diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.cs index ebcaee6ddfe55a..4d0d8d7a84d0d4 100644 --- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.cs +++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.cs @@ -873,6 +873,7 @@ private static bool IsValidForGenericMarshalling( // * Vector64: Represents the __m64 ABI primitive which requires currently unimplemented handling // * Vector128: Represents the __m128 ABI primitive which requires currently unimplemented handling // * Vector256: Represents the __m256 ABI primitive which requires currently unimplemented handling + // * Vector512: Represents the __m512 ABI primitive which requires currently unimplemented handling // * Vector: Has a variable size (either __m128 or __m256) and isn't readily usable for interop scenarios return !InteropTypes.IsSystemNullable(type.Context, type) && !InteropTypes.IsSystemSpan(type.Context, type) @@ -880,6 +881,7 @@ private static bool IsValidForGenericMarshalling( && !InteropTypes.IsSystemRuntimeIntrinsicsVector64T(type.Context, type) && !InteropTypes.IsSystemRuntimeIntrinsicsVector128T(type.Context, type) && !InteropTypes.IsSystemRuntimeIntrinsicsVector256T(type.Context, type) + && !InteropTypes.IsSystemRuntimeIntrinsicsVector512T(type.Context, type) && !InteropTypes.IsSystemNumericsVectorT(type.Context, type); } diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/InteropTypes.cs b/src/coreclr/tools/Common/TypeSystem/Interop/InteropTypes.cs index 8bbdb13630bfe3..3beeb5f187a89e 100644 --- a/src/coreclr/tools/Common/TypeSystem/Interop/InteropTypes.cs +++ b/src/coreclr/tools/Common/TypeSystem/Interop/InteropTypes.cs @@ -145,6 +145,11 @@ public static bool IsSystemRuntimeIntrinsicsVector256T(TypeSystemContext context return IsCoreNamedType(context, type, "System.Runtime.Intrinsics", "Vector256`1"); } + public static bool IsSystemRuntimeIntrinsicsVector512T(TypeSystemContext context, TypeDesc type) + { + return IsCoreNamedType(context, type, "System.Runtime.Intrinsics", "Vector512`1"); + } + public static bool IsSystemNumericsVectorT(TypeSystemContext context, TypeDesc type) { return IsCoreNamedType(context, type, "System.Numerics", "Vector`1"); diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/VectorOfTFieldLayoutAlgorithm.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/VectorOfTFieldLayoutAlgorithm.cs index e0e175c0dcefea..1a1eef14d55820 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/VectorOfTFieldLayoutAlgorithm.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/VectorOfTFieldLayoutAlgorithm.cs @@ -36,6 +36,10 @@ public override ComputedInstanceFieldLayout ComputeInstanceLayout(DefType defTyp { instanceFieldSize = new LayoutInt(32); } + else if (targetDetails.MaximumSimdVectorLength == SimdVectorLength.Vector512Bit) + { + instanceFieldSize = new LayoutInt(64); + } else { Debug.Assert(targetDetails.MaximumSimdVectorLength == SimdVectorLength.None); diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilerContext.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilerContext.cs index 73dcd33c1b2f99..88a74a9ebc2f00 100644 --- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilerContext.cs +++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilerContext.cs @@ -52,6 +52,8 @@ public ReadyToRunCompilerContext(TargetDetails details, SharedGenericsMode gener matchingVectorType = "Vector128`1"; else if (details.MaximumSimdVectorLength == SimdVectorLength.Vector256Bit) matchingVectorType = "Vector256`1"; + else if (details.MaximumSimdVectorLength == SimdVectorLength.Vector512Bit) + matchingVectorType = "Vector512`1"; // No architecture has completely stable handling of Vector in the abi (Arm64 may change to SVE) _vectorOfTFieldLayoutAlgorithm = new VectorOfTFieldLayoutAlgorithm(_r2rFieldLayoutAlgorithm, _vectorFieldLayoutAlgorithm, matchingVectorType, bubbleIncludesCorelib); diff --git a/src/coreclr/vm/classlayoutinfo.cpp b/src/coreclr/vm/classlayoutinfo.cpp index a37d7a06521216..c326a3e26e15ba 100644 --- a/src/coreclr/vm/classlayoutinfo.cpp +++ b/src/coreclr/vm/classlayoutinfo.cpp @@ -162,6 +162,7 @@ namespace case 8: case 16: case 32: + case 64: break; default: COMPlusThrowHR(COR_E_INVALIDPROGRAM, BFA_METADATA_CORRUPT); @@ -979,7 +980,8 @@ EEClassNativeLayoutInfo* EEClassNativeLayoutInfo::CollectNativeLayoutFieldMetada pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__UINT128)) || pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__VECTOR64T)) || pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__VECTOR128T)) || - pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__VECTOR256T))) + pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__VECTOR256T)) || + pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__VECTOR512T))) { pNativeLayoutInfo->m_alignmentRequirement = pEEClassLayoutInfo->m_ManagedLargestAlignmentRequirementOfAllMembers; } diff --git a/src/coreclr/vm/classnames.h b/src/coreclr/vm/classnames.h index 00a192fd36f39b..29ee7c26d5e84d 100644 --- a/src/coreclr/vm/classnames.h +++ b/src/coreclr/vm/classnames.h @@ -52,6 +52,9 @@ #define g_Vector256ClassName "System.Runtime.Intrinsics.Vector256`1" #define g_Vector256Name "Vector256`1" +#define g_Vector512ClassName "System.Runtime.Intrinsics.Vector512`1" +#define g_Vector512Name "Vector512`1" + #define g_EnumeratorToEnumClassName "System.Runtime.InteropServices.CustomMarshalers.EnumeratorToEnumVariantMarshaler" #define g_ExceptionClassName "System.Exception" #define g_ExecutionEngineExceptionClassName "System.ExecutionEngineException" diff --git a/src/coreclr/vm/corelib.h b/src/coreclr/vm/corelib.h index 1a7d26e42dc51f..059f05831c4160 100644 --- a/src/coreclr/vm/corelib.h +++ b/src/coreclr/vm/corelib.h @@ -484,6 +484,7 @@ DEFINE_METHOD(NATIVELIBRARY, LOADLIBRARYCALLBACKSTUB, LoadLibraryCallback DEFINE_CLASS(VECTOR64T, Intrinsics, Vector64`1) DEFINE_CLASS(VECTOR128T, Intrinsics, Vector128`1) DEFINE_CLASS(VECTOR256T, Intrinsics, Vector256`1) +DEFINE_CLASS(VECTOR512T, Intrinsics, Vector512`1) DEFINE_CLASS(VECTORT, Numerics, Vector`1) diff --git a/src/coreclr/vm/fieldmarshaler.h b/src/coreclr/vm/fieldmarshaler.h index a5c77ca5bfd11d..83b2c79fb4f055 100644 --- a/src/coreclr/vm/fieldmarshaler.h +++ b/src/coreclr/vm/fieldmarshaler.h @@ -24,7 +24,7 @@ class MethodTable; // Currently we set this to the packing size of the largest supported // fundamental type and let the field marshaller downsize where needed. //======================================================================= -#define DEFAULT_PACKING_SIZE 32 +#define DEFAULT_PACKING_SIZE 64 //======================================================================= // This structure contains information about where a field is placed in a structure, as well as it's size and alignment. diff --git a/src/coreclr/vm/methodtable.cpp b/src/coreclr/vm/methodtable.cpp index e61162ac553c89..8a398f20c4c93c 100644 --- a/src/coreclr/vm/methodtable.cpp +++ b/src/coreclr/vm/methodtable.cpp @@ -2237,8 +2237,8 @@ bool MethodTable::ClassifyEightBytesWithManagedLayout(SystemVStructRegisterPassi LPCUTF8 namespaceName; LPCUTF8 className = GetFullyQualifiedNameInfo(&namespaceName); - if ((strcmp(className, "Vector256`1") == 0) || (strcmp(className, "Vector128`1") == 0) || - (strcmp(className, "Vector64`1") == 0)) + if ((strcmp(className, "Vector512`1") == 0) || (strcmp(className, "Vector256`1") == 0) || + (strcmp(className, "Vector128`1") == 0) || (strcmp(className, "Vector64`1") == 0)) { assert(strcmp(namespaceName, "System.Runtime.Intrinsics") == 0); @@ -2487,8 +2487,8 @@ bool MethodTable::ClassifyEightBytesWithNativeLayout(SystemVStructRegisterPassin LPCUTF8 namespaceName; LPCUTF8 className = GetFullyQualifiedNameInfo(&namespaceName); - if ((strcmp(className, "Vector256`1") == 0) || (strcmp(className, "Vector128`1") == 0) || - (strcmp(className, "Vector64`1") == 0)) + if ((strcmp(className, "Vector512`1") == 0) || (strcmp(className, "Vector256`1") == 0) || + (strcmp(className, "Vector128`1") == 0) || (strcmp(className, "Vector64`1") == 0)) { assert(strcmp(namespaceName, "System.Runtime.Intrinsics") == 0); diff --git a/src/coreclr/vm/methodtablebuilder.cpp b/src/coreclr/vm/methodtablebuilder.cpp index be4fee76f2f3f3..afe78952aa15ab 100644 --- a/src/coreclr/vm/methodtablebuilder.cpp +++ b/src/coreclr/vm/methodtablebuilder.cpp @@ -9884,6 +9884,22 @@ void MethodTableBuilder::CheckForSystemTypes() pLayout->m_ManagedLargestAlignmentRequirementOfAllMembers = 16; #else pLayout->m_ManagedLargestAlignmentRequirementOfAllMembers = 32; // sizeof(__m256) + #endif // TARGET_ARM elif TARGET_ARM64 + } + else if (strcmp(name, g_Vector512Name) == 0) + { + #ifdef TARGET_ARM + // No such type exists for the Procedure Call Standard for ARM. We will default + // to the same alignment as __m128, which is supported by the ABI. + + pLayout->m_ManagedLargestAlignmentRequirementOfAllMembers = 8; + #elif defined(TARGET_ARM64) + // The Procedure Call Standard for ARM 64-bit (with SVE support) defaults to + // 16-byte alignment for __m256. + + pLayout->m_ManagedLargestAlignmentRequirementOfAllMembers = 16; + #else + pLayout->m_ManagedLargestAlignmentRequirementOfAllMembers = 64; // sizeof(__m512) #endif // TARGET_ARM elif TARGET_ARM64 } else diff --git a/src/coreclr/vm/mlinfo.cpp b/src/coreclr/vm/mlinfo.cpp index 12fc856c1d9bc1..55110cc82a2dc3 100644 --- a/src/coreclr/vm/mlinfo.cpp +++ b/src/coreclr/vm/mlinfo.cpp @@ -1081,6 +1081,7 @@ namespace // * Vector64: Represents the __m64 ABI primitive which requires currently unimplemented handling // * Vector128: Represents the __m128 ABI primitive which requires currently unimplemented handling // * Vector256: Represents the __m256 ABI primitive which requires currently unimplemented handling + // * Vector512: Represents the __m512 ABI primitive which requires currently unimplemented handling // * Vector: Has a variable size (either __m128 or __m256) and isn't readily usable for interop scenarios return !pMT->HasSameTypeDefAs(g_pNullableClass) && !pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__SPAN)) @@ -1088,6 +1089,7 @@ namespace && !pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__VECTOR64T)) && !pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__VECTOR128T)) && !pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__VECTOR256T)) + && !pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__VECTOR512T)) && !pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__VECTORT)); } diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c index c2d9dd6a31d593..ca30a0a67a482f 100644 --- a/src/mono/mono/mini/mini-llvm.c +++ b/src/mono/mono/mini/mini-llvm.c @@ -643,7 +643,7 @@ simd_class_to_llvm_type (EmitContext *ctx, MonoClass *klass) return LLVMVectorType (LLVMFloatType (), 4); } else if (!strcmp (klass_name, "Vector4")) { return LLVMVectorType (LLVMFloatType (), 4); - } else if (!strcmp (klass_name, "Vector`1") || !strcmp (klass_name, "Vector64`1") || !strcmp (klass_name, "Vector128`1") || !strcmp (klass_name, "Vector256`1")) { + } else if (!strcmp (klass_name, "Vector`1") || !strcmp (klass_name, "Vector64`1") || !strcmp (klass_name, "Vector128`1") || !strcmp (klass_name, "Vector256`1") || !strcmp (klass_name, "Vector512`1")) { MonoType *etype = mono_class_get_generic_class (klass)->context.class_inst->type_argv [0]; int size = mono_class_value_size (klass, NULL); switch (etype->type) { diff --git a/src/mono/mono/mini/mini-runtime.c b/src/mono/mono/mini/mini-runtime.c index c66a227a242fd9..041a2596172cad 100644 --- a/src/mono/mono/mini/mini-runtime.c +++ b/src/mono/mono/mini/mini-runtime.c @@ -4364,7 +4364,7 @@ init_class (MonoClass *klass) #endif if (m_class_is_ginst (klass)) { - if (!strcmp (name, "Vector`1") || !strcmp (name, "Vector64`1") || !strcmp (name, "Vector128`1") || !strcmp (name, "Vector256`1")) { + if (!strcmp (name, "Vector`1") || !strcmp (name, "Vector64`1") || !strcmp (name, "Vector128`1") || !strcmp (name, "Vector256`1") || !strcmp (name, "Vector512`1")) { MonoGenericClass *gclass = mono_class_try_get_generic_class (klass); g_assert (gclass); MonoType *etype = gclass->context.class_inst->type_argv [0]; diff --git a/src/mono/mono/mini/simd-intrinsics.c b/src/mono/mono/mini/simd-intrinsics.c index a33bd00f3c2993..4708747f1ffa5c 100644 --- a/src/mono/mono/mini/simd-intrinsics.c +++ b/src/mono/mono/mini/simd-intrinsics.c @@ -651,7 +651,7 @@ is_intrinsics_vector_type (MonoType *vector_type) if (vector_type->type != MONO_TYPE_GENERICINST) return FALSE; MonoClass *klass = mono_class_from_mono_type_internal (vector_type); const char *name = m_class_get_name (klass); - return !strcmp (name, "Vector64`1") || !strcmp (name, "Vector128`1") || !strcmp (name, "Vector256`1"); + return !strcmp (name, "Vector64`1") || !strcmp (name, "Vector128`1") || !strcmp (name, "Vector256`1") || !strcmp (name, "Vector512`1"); } static MonoType* @@ -666,7 +666,8 @@ get_vector_t_elem_type (MonoType *vector_type) !strcmp (m_class_get_name (klass), "Vector`1") || !strcmp (m_class_get_name (klass), "Vector64`1") || !strcmp (m_class_get_name (klass), "Vector128`1") || - !strcmp (m_class_get_name (klass), "Vector256`1")); + !strcmp (m_class_get_name (klass), "Vector256`1") || + !strcmp (m_class_get_name (klass), "Vector512`1")); etype = mono_class_get_context (klass)->class_inst->type_argv [0]; return etype; } From 3a80f29cbd4ea20f7a026658be35b5c2eca47b35 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Fri, 28 Oct 2022 10:30:00 -0700 Subject: [PATCH 03/26] Responding to PR feedback and ensure Vector512 is treated as an HFA for Arm64 --- .../tools/Common/Compiler/VectorFieldLayoutAlgorithm.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/coreclr/tools/Common/Compiler/VectorFieldLayoutAlgorithm.cs b/src/coreclr/tools/Common/Compiler/VectorFieldLayoutAlgorithm.cs index a8770e13851d1f..ac5247190775ae 100644 --- a/src/coreclr/tools/Common/Compiler/VectorFieldLayoutAlgorithm.cs +++ b/src/coreclr/tools/Common/Compiler/VectorFieldLayoutAlgorithm.cs @@ -46,8 +46,6 @@ public override ComputedInstanceFieldLayout ComputeInstanceLayout(DefType defTyp } else if (name == "Vector256`1") { - Debug.Assert(name == "Vector256`1"); - if (defType.Context.Target.Architecture == TargetArchitecture.ARM) { // No such type exists for the Procedure Call Standard for ARM. We will default @@ -127,6 +125,7 @@ public override ValueTypeShapeCharacteristics ComputeValueTypeShapeCharacteristi 8 => ValueTypeShapeCharacteristics.Vector64Aggregate, 16 => ValueTypeShapeCharacteristics.Vector128Aggregate, 32 => ValueTypeShapeCharacteristics.Vector128Aggregate, + 64 => ValueTypeShapeCharacteristics.Vector128Aggregate, _ => ValueTypeShapeCharacteristics.None }; } From 13dc1dfa48830b66c1e3f24e8851be48abbbfdb2 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Fri, 4 Nov 2022 09:11:54 -0700 Subject: [PATCH 04/26] Bring Vector512 inline with the new Vector64/128/256 APIs --- .../System/Runtime/Intrinsics/Vector128_1.cs | 52 +-- .../System/Runtime/Intrinsics/Vector256.cs | 12 +- .../System/Runtime/Intrinsics/Vector256_1.cs | 53 +--- .../System/Runtime/Intrinsics/Vector512.cs | 297 +++++++++++------- .../System/Runtime/Intrinsics/Vector512_1.cs | 69 ++++ 5 files changed, 285 insertions(+), 198 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs index 541f64416fca04..b8e80993de38d2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs @@ -198,15 +198,10 @@ public T this[int index] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 operator /(Vector128 left, T right) { - Unsafe.SkipInit(out Vector128 result); - - for (int index = 0; index < Count; index++) - { - T value = Scalar.Divide(left.GetElementUnsafe(index), right); - result.SetElementUnsafe(index, value); - } - - return result; + return Vector128.Create( + left._lower / right, + left._upper / right + ); } /// Compares two vectors to determine if all elements are equal. @@ -258,15 +253,10 @@ public T this[int index] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 operator <<(Vector128 value, int shiftCount) { - Unsafe.SkipInit(out Vector128 result); - - for (int index = 0; index < Count; index++) - { - T element = Scalar.ShiftLeft(value.GetElementUnsafe(index), shiftCount); - result.SetElementUnsafe(index, element); - } - - return result; + return Vector128.Create( + value._lower << shiftCount, + value._upper << shiftCount + ); } /// Multiplies two vectors to compute their element-wise product. @@ -330,15 +320,10 @@ public T this[int index] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 operator >>(Vector128 value, int shiftCount) { - Unsafe.SkipInit(out Vector128 result); - - for (int index = 0; index < Count; index++) - { - T element = Scalar.ShiftRightArithmetic(value.GetElementUnsafe(index), shiftCount); - result.SetElementUnsafe(index, element); - } - - return result; + return Vector128.Create( + value._lower >> shiftCount, + value._upper >> shiftCount + ); } /// Subtracts two vectors to compute their difference. @@ -390,15 +375,10 @@ public static Vector128 operator >>(Vector128 value, int shiftCount) [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector128 operator >>>(Vector128 value, int shiftCount) { - Unsafe.SkipInit(out Vector128 result); - - for (int index = 0; index < Count; index++) - { - T element = Scalar.ShiftRightLogical(value.GetElementUnsafe(index), shiftCount); - result.SetElementUnsafe(index, element); - } - - return result; + return Vector128.Create( + value._lower >>> shiftCount, + value._upper >>> shiftCount + ); } /// Determines whether the specified object is equal to the current instance. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs index bde786a4b07f7b..49114cf1a635eb 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs @@ -2833,7 +2833,7 @@ public static bool TryCopyTo(this Vector256 vector, Span destination) [MethodImpl(MethodImplOptions.AggressiveInlining)] public static (Vector256 Lower, Vector256 Upper) Widen(Vector256 source) => (WidenLower(source), WidenUpper(source)); - /// Widens the lower half of a into a . + /// Widens the lower half of a into a . /// The vector whose elements are to be widened. /// A vector that contain the widened lower half of . [Intrinsic] @@ -2849,7 +2849,7 @@ public static Vector256 WidenLower(Vector256 source) ); } - /// Widens the lower half of a into a . + /// Widens the lower half of a into a . /// The vector whose elements are to be widened. /// A vector that contain the widened lower half of . [Intrinsic] @@ -2864,7 +2864,7 @@ public static Vector256 WidenLower(Vector256 source) ); } - /// Widens the lower half of a into a . + /// Widens the lower half of a into a . /// The vector whose elements are to be widened. /// A vector that contain the widened lower half of . [Intrinsic] @@ -2879,7 +2879,7 @@ public static Vector256 WidenLower(Vector256 source) ); } - /// Widens the lower half of a into a . + /// Widens the lower half of a into a . /// The vector whose elements are to be widened. /// A vector that contain the widened lower half of . [Intrinsic] @@ -2894,7 +2894,7 @@ public static Vector256 WidenLower(Vector256 source) Vector128.WidenUpper(lower) ); } - /// Widens the lower half of a into a . + /// Widens the lower half of a into a . /// The vector whose elements are to be widened. /// A vector that contain the widened lower half of . [Intrinsic] @@ -2909,7 +2909,7 @@ public static Vector256 WidenLower(Vector256 source) ); } - /// Widens the lower half of a into a . + /// Widens the lower half of a into a . /// The vector whose elements are to be widened. /// A vector that contain the widened lower half of . [Intrinsic] diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs index caa8fe308a2ea7..56e19827b31b4a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs @@ -4,7 +4,6 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; -using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; @@ -197,15 +196,10 @@ public T this[int index] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 operator /(Vector256 left, T right) { - Unsafe.SkipInit(out Vector256 result); - - for (int index = 0; index < Count; index++) - { - T value = Scalar.Divide(left.GetElementUnsafe(index), right); - result.SetElementUnsafe(index, value); - } - - return result; + return Vector256.Create( + left._lower / right, + left._upper / right + ); } /// Compares two vectors to determine if all elements are equal. @@ -257,15 +251,10 @@ public T this[int index] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 operator <<(Vector256 value, int shiftCount) { - Unsafe.SkipInit(out Vector256 result); - - for (int index = 0; index < Count; index++) - { - T element = Scalar.ShiftLeft(value.GetElementUnsafe(index), shiftCount); - result.SetElementUnsafe(index, element); - } - - return result; + return Vector256.Create( + value._lower << shiftCount, + value._upper << shiftCount + ); } /// Multiplies two vectors to compute their element-wise product. @@ -329,15 +318,10 @@ public T this[int index] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 operator >>(Vector256 value, int shiftCount) { - Unsafe.SkipInit(out Vector256 result); - - for (int index = 0; index < Count; index++) - { - T element = Scalar.ShiftRightArithmetic(value.GetElementUnsafe(index), shiftCount); - result.SetElementUnsafe(index, element); - } - - return result; + return Vector256.Create( + value._lower >> shiftCount, + value._upper >> shiftCount + ); } /// Subtracts two vectors to compute their difference. @@ -389,15 +373,10 @@ public static Vector256 operator >>(Vector256 value, int shiftCount) [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector256 operator >>>(Vector256 value, int shiftCount) { - Unsafe.SkipInit(out Vector256 result); - - for (int index = 0; index < Count; index++) - { - T element = Scalar.ShiftRightLogical(value.GetElementUnsafe(index), shiftCount); - result.SetElementUnsafe(index, element); - } - - return result; + return Vector256.Create( + value._lower >>> shiftCount, + value._upper >>> shiftCount + ); } /// Determines whether the specified object is equal to the current instance. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs index 908366b5f8d62a..9034a1e5de4a39 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs @@ -1102,7 +1102,7 @@ public static Vector512 Create(ulong e0, ulong e1, ulong e2, ulong e3, ul /// A new initialized from and . /// The type of and () is not supported. [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 Create(Vector256 lower, Vector256 upper) + public static Vector512 Create(Vector256 lower, Vector256 upper) where T : struct { ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); @@ -1156,14 +1156,14 @@ internal static Vector512 Create(Vector256 lower, Vector256 upper) /// The value that the upper 256-bits will be initialized to. /// A new initialized from and . [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); + public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); /// Creates a new instance from two instances. /// The value that the lower 256-bits will be initialized to. /// The value that the upper 256-bits will be initialized to. /// A new initialized from and . [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); + public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); /// Creates a new instance from two instances. /// The value that the lower 256-bits will be initialized to. @@ -1212,7 +1212,7 @@ internal static Vector512 Create(Vector256 lower, Vector256 upper) /// A new instance with the first element initialized to and the remaining elements initialized to zero. /// The type of () is not supported. [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 CreateScalar(T value) + public static Vector512 CreateScalar(T value) where T : struct => Vector256.CreateScalar(value).ToVector512(); /// Creates a new instance with the first element initialized to the specified value and the remaining elements initialized to zero. @@ -1299,7 +1299,7 @@ internal static Vector512 CreateScalar(T value) /// The type of () is not supported. [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 CreateScalarUnsafe(T value) + public static Vector512 CreateScalarUnsafe(T value) where T : struct { // This relies on us stripping the "init" flag from the ".locals" @@ -1418,6 +1418,16 @@ public static Vector512 Divide(Vector512 left, Vector512 right) ); } + /// Divides a vector by a scalar to compute the per-element quotient. + /// The vector that will be divided by . + /// The scalar that will divide . + /// The type of the elements in the vector. + /// The quotient of divided by . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Divide(Vector512 left, T right) + where T : struct => left / right; + /// Computes the dot product of two vectors. /// The type of the elements in the vector. /// The vector that will be dotted with . @@ -2837,108 +2847,13 @@ public static bool TryCopyTo(this Vector512 vector, Span destination) [MethodImpl(MethodImplOptions.AggressiveInlining)] public static (Vector512 Lower, Vector512 Upper) Widen(Vector512 source) => (WidenLower(source), WidenUpper(source)); - /// Creates a new with the element at the specified index set to the specified value and the remaining elements set to the same value as that in the given vector. - /// The type of the input vector. - /// The vector to get the remaining elements from. - /// The index of the element to set. - /// The value to set the element to. - /// A with the value of the element at set to and the remaining elements set to the same value as that in . - /// was less than zero or greater than the number of elements. - /// The type of () is not supported. - [Intrinsic] - public static Vector512 WithElement(this Vector512 vector, int index, T value) - where T : struct - { - if ((uint)(index) >= (uint)(Vector512.Count)) - { - ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.index); - } - - Vector512 result = vector; - result.SetElementUnsafe(index, value); - return result; - } - - /// Creates a new with the lower 256-bits set to the specified value and the upper 256-bits set to the same value as that in the given vector. - /// The type of the input vector. - /// The vector to get the upper 256-bits from. - /// The value of the lower 256-bits as a . - /// A new with the lower 256-bits set to and the upper 256-bits set to the same value as that in . - /// The type of () is not supported. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector512 WithLower(this Vector512 vector, Vector256 value) - where T : struct - { - ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); - - Vector512 result = vector; - result.SetLowerUnsafe(value); - return result; - } - - /// Creates a new with the upper 256-bits set to the specified value and the upper 256-bits set to the same value as that in the given vector. - /// The type of the input vector. - /// The vector to get the lower 256-bits from. - /// The value of the upper 256-bits as a . - /// A new with the upper 256-bits set to and the lower 256-bits set to the same value as that in . - /// The type of () is not supported. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector512 WithUpper(this Vector512 vector, Vector256 value) - where T : struct - { - ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); - - Vector512 result = vector; - result.SetUpperUnsafe(value); - return result; - } - - /// Computes the exclusive-or of two vectors. - /// The type of the elements in the vector. - /// The vector to exclusive-or with . - /// The vector to exclusive-or with . - /// The exclusive-or of and . - /// The type of and () is not supported. - [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vector512 Xor(Vector512 left, Vector512 right) - where T : struct => left ^ right; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static T GetElementUnsafe(in this Vector512 vector, int index) - where T : struct - { - Debug.Assert((index >= 0) && (index < Vector512.Count)); - ref T address = ref Unsafe.As, T>(ref Unsafe.AsRef(in vector)); - return Unsafe.Add(ref address, index); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static void SetElementUnsafe(in this Vector512 vector, int index, T value) - where T : struct - { - Debug.Assert((index >= 0) && (index < Vector512.Count)); - ref T address = ref Unsafe.As, T>(ref Unsafe.AsRef(in vector)); - Unsafe.Add(ref address, index) = value; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static void SetLowerUnsafe(in this Vector512 vector, Vector256 value) - where T : struct - { - Unsafe.AsRef(in vector._lower) = value; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static void SetUpperUnsafe(in this Vector512 vector, Vector256 value) - where T : struct - { - Unsafe.AsRef(in vector._upper) = value; - } - + /// Widens the lower half of a into a . + /// The vector whose elements are to be widened. + /// A vector that contain the widened lower half of . [Intrinsic] + [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 WidenLower(Vector512 source) + public static Vector512 WidenLower(Vector512 source) { Vector256 lower = source._lower; @@ -2948,9 +2863,12 @@ internal static Vector512 WidenLower(Vector512 source) ); } + /// Widens the lower half of a into a . + /// The vector whose elements are to be widened. + /// A vector that contain the widened lower half of . [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 WidenLower(Vector512 source) + public static Vector512 WidenLower(Vector512 source) { Vector256 lower = source._lower; @@ -2960,9 +2878,12 @@ internal static Vector512 WidenLower(Vector512 source) ); } + /// Widens the lower half of a into a . + /// The vector whose elements are to be widened. + /// A vector that contain the widened lower half of . [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 WidenLower(Vector512 source) + public static Vector512 WidenLower(Vector512 source) { Vector256 lower = source._lower; @@ -2972,9 +2893,13 @@ internal static Vector512 WidenLower(Vector512 source) ); } + /// Widens the lower half of a into a . + /// The vector whose elements are to be widened. + /// A vector that contain the widened lower half of . [Intrinsic] + [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 WidenLower(Vector512 source) + public static Vector512 WidenLower(Vector512 source) { Vector256 lower = source._lower; @@ -2983,10 +2908,12 @@ internal static Vector512 WidenLower(Vector512 source) Vector256.WidenUpper(lower) ); } - + /// Widens the lower half of a into a . + /// The vector whose elements are to be widened. + /// A vector that contain the widened lower half of . [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 WidenLower(Vector512 source) + public static Vector512 WidenLower(Vector512 source) { Vector256 lower = source._lower; @@ -2996,9 +2923,13 @@ internal static Vector512 WidenLower(Vector512 source) ); } + /// Widens the lower half of a into a . + /// The vector whose elements are to be widened. + /// A vector that contain the widened lower half of . [Intrinsic] + [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 WidenLower(Vector512 source) + public static Vector512 WidenLower(Vector512 source) { Vector256 lower = source._lower; @@ -3008,9 +2939,13 @@ internal static Vector512 WidenLower(Vector512 source) ); } + /// Widens the lower half of a into a . + /// The vector whose elements are to be widened. + /// A vector that contain the widened lower half of . [Intrinsic] + [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 WidenLower(Vector512 source) + public static Vector512 WidenLower(Vector512 source) { Vector256 lower = source._lower; @@ -3020,9 +2955,13 @@ internal static Vector512 WidenLower(Vector512 source) ); } + /// Widens the upper half of a into a . + /// The vector whose elements are to be widened. + /// A vector that contain the widened upper half of . [Intrinsic] + [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 WidenUpper(Vector512 source) + public static Vector512 WidenUpper(Vector512 source) { Vector256 upper = source._upper; @@ -3032,9 +2971,12 @@ internal static Vector512 WidenUpper(Vector512 source) ); } + /// Widens the upper half of a into a . + /// The vector whose elements are to be widened. + /// A vector that contain the widened upper half of . [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 WidenUpper(Vector512 source) + public static Vector512 WidenUpper(Vector512 source) { Vector256 upper = source._upper; @@ -3044,9 +2986,12 @@ internal static Vector512 WidenUpper(Vector512 source) ); } + /// Widens the upper half of a into a . + /// The vector whose elements are to be widened. + /// A vector that contain the widened upper half of . [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 WidenUpper(Vector512 source) + public static Vector512 WidenUpper(Vector512 source) { Vector256 upper = source._upper; @@ -3056,9 +3001,13 @@ internal static Vector512 WidenUpper(Vector512 source) ); } + /// Widens the upper half of a into a . + /// The vector whose elements are to be widened. + /// A vector that contain the widened upper half of . [Intrinsic] + [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 WidenUpper(Vector512 source) + public static Vector512 WidenUpper(Vector512 source) { Vector256 upper = source._upper; @@ -3068,9 +3017,12 @@ internal static Vector512 WidenUpper(Vector512 source) ); } + /// Widens the upper half of a into a . + /// The vector whose elements are to be widened. + /// A vector that contain the widened upper half of . [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 WidenUpper(Vector512 source) + public static Vector512 WidenUpper(Vector512 source) { Vector256 upper = source._upper; @@ -3080,9 +3032,13 @@ internal static Vector512 WidenUpper(Vector512 source) ); } + /// Widens the upper half of a into a . + /// The vector whose elements are to be widened. + /// A vector that contain the widened upper half of . [Intrinsic] + [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 WidenUpper(Vector512 source) + public static Vector512 WidenUpper(Vector512 source) { Vector256 upper = source._upper; @@ -3092,9 +3048,13 @@ internal static Vector512 WidenUpper(Vector512 source) ); } + /// Widens the upper half of a into a . + /// The vector whose elements are to be widened. + /// A vector that contain the widened upper half of . [Intrinsic] + [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Vector512 WidenUpper(Vector512 source) + public static Vector512 WidenUpper(Vector512 source) { Vector256 upper = source._upper; @@ -3103,5 +3063,104 @@ internal static Vector512 WidenUpper(Vector512 source) Vector256.WidenUpper(upper) ); } + + /// Creates a new with the element at the specified index set to the specified value and the remaining elements set to the same value as that in the given vector. + /// The type of the input vector. + /// The vector to get the remaining elements from. + /// The index of the element to set. + /// The value to set the element to. + /// A with the value of the element at set to and the remaining elements set to the same value as that in . + /// was less than zero or greater than the number of elements. + /// The type of () is not supported. + [Intrinsic] + public static Vector512 WithElement(this Vector512 vector, int index, T value) + where T : struct + { + if ((uint)(index) >= (uint)(Vector512.Count)) + { + ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.index); + } + + Vector512 result = vector; + result.SetElementUnsafe(index, value); + return result; + } + + /// Creates a new with the lower 256-bits set to the specified value and the upper 256-bits set to the same value as that in the given vector. + /// The type of the input vector. + /// The vector to get the upper 256-bits from. + /// The value of the lower 256-bits as a . + /// A new with the lower 256-bits set to and the upper 256-bits set to the same value as that in . + /// The type of () is not supported. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 WithLower(this Vector512 vector, Vector256 value) + where T : struct + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + + Vector512 result = vector; + result.SetLowerUnsafe(value); + return result; + } + + /// Creates a new with the upper 256-bits set to the specified value and the upper 256-bits set to the same value as that in the given vector. + /// The type of the input vector. + /// The vector to get the lower 256-bits from. + /// The value of the upper 256-bits as a . + /// A new with the upper 256-bits set to and the lower 256-bits set to the same value as that in . + /// The type of () is not supported. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 WithUpper(this Vector512 vector, Vector256 value) + where T : struct + { + ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); + + Vector512 result = vector; + result.SetUpperUnsafe(value); + return result; + } + + /// Computes the exclusive-or of two vectors. + /// The type of the elements in the vector. + /// The vector to exclusive-or with . + /// The vector to exclusive-or with . + /// The exclusive-or of and . + /// The type of and () is not supported. + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Xor(Vector512 left, Vector512 right) + where T : struct => left ^ right; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static T GetElementUnsafe(in this Vector512 vector, int index) + where T : struct + { + Debug.Assert((index >= 0) && (index < Vector512.Count)); + ref T address = ref Unsafe.As, T>(ref Unsafe.AsRef(in vector)); + return Unsafe.Add(ref address, index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void SetElementUnsafe(in this Vector512 vector, int index, T value) + where T : struct + { + Debug.Assert((index >= 0) && (index < Vector512.Count)); + ref T address = ref Unsafe.As, T>(ref Unsafe.AsRef(in vector)); + Unsafe.Add(ref address, index) = value; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void SetLowerUnsafe(in this Vector512 vector, Vector256 value) + where T : struct + { + Unsafe.AsRef(in vector._lower) = value; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void SetUpperUnsafe(in this Vector512 vector, Vector256 value) + where T : struct + { + Unsafe.AsRef(in vector._upper) = value; + } } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs index 59dafd3292268a..1edf3894f63d90 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs @@ -80,6 +80,19 @@ public static bool IsSupported } } + /// Gets a new with all elements initialized to one. + /// The type of the current instance () is not supported. + public static Vector512 One + { + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + Vector256 vector = Vector256.One; + return Vector512.Create(vector, vector); + } + } + /// Gets a new with all elements initialized to zero. /// The type of the vector () is not supported. public static Vector512 Zero @@ -175,6 +188,20 @@ public T this[int index] ); } + /// Divides a vector by a scalar to compute the per-element quotient. + /// The vector that will be divided by . + /// The scalar that will divide . + /// The quotient of divided by . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 operator /(Vector512 left, T right) + { + return Vector512.Create( + left._lower / right, + left._upper / right + ); + } + /// Compares two vectors to determine if all elements are equal. /// The vector to compare with . /// The vector to compare with . @@ -216,6 +243,20 @@ public T this[int index] || (left._upper != right._upper); } + /// Shifts each element of a vector left by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted left by . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 operator <<(Vector512 value, int shiftCount) + { + return Vector512.Create( + value._lower << shiftCount, + value._upper << shiftCount + ); + } + /// Multiplies two vectors to compute their element-wise product. /// The vector to multiply with . /// The vector to multiply with . @@ -269,6 +310,20 @@ public T this[int index] ); } + /// Shifts (signed) each element of a vector right by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted right by . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 operator >>(Vector512 value, int shiftCount) + { + return Vector512.Create( + value._lower >> shiftCount, + value._upper >> shiftCount + ); + } + /// Subtracts two vectors to compute their difference. /// The vector from which will be subtracted. /// The vector to subtract from . @@ -310,6 +365,20 @@ public T this[int index] return value; } + /// Shifts (unsigned) each element of a vector right by the specified amount. + /// The vector whose elements are to be shifted. + /// The number of bits by which to shift each element. + /// A vector whose elements where shifted right by . + [Intrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 operator >>>(Vector512 value, int shiftCount) + { + return Vector512.Create( + value._lower >>> shiftCount, + value._upper >>> shiftCount + ); + } + /// Determines whether the specified object is equal to the current instance. /// The object to compare with the current instance. /// true if is a and is equal to the current instance; otherwise, false. From 5e64c5f7d7ab0593a13c66fc312bbe317f0a9a23 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Wed, 26 Oct 2022 08:58:19 -0700 Subject: [PATCH 05/26] Adding support for generating the Vector512 tests --- .../General/Shared/GenerateTests.csx | 727 ++++++++++++++++++ 1 file changed, 727 insertions(+) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/GenerateTests.csx b/src/tests/JIT/HardwareIntrinsics/General/Shared/GenerateTests.csx index bc17c8b38939a7..e131b642414459 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/GenerateTests.csx +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/GenerateTests.csx @@ -2010,6 +2010,685 @@ private static readonly (string templateFileName, Dictionary tem ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector256", ["Method"] = "op_UnaryPlus", ["Opcode"] = "+", ["RetVectorType"] = "Vector256", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector256", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(+firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(+firstOp[i])" }), }; +private static readonly (string templateFileName, Dictionary templateData)[] Vector512Inputs = new [] +{ + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Abs", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != firstOp[0]", ["ValidateRemainingResults"] = "result[i] != firstOp[i]" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Abs", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != Math.Abs(firstOp[0])", ["ValidateRemainingResults"] = "result[i] != Math.Abs(firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Abs", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != Math.Abs(firstOp[0])", ["ValidateRemainingResults"] = "result[i] != Math.Abs(firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Abs", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != Math.Abs(firstOp[0])", ["ValidateRemainingResults"] = "result[i] != Math.Abs(firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Abs", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != Math.Abs(firstOp[0])", ["ValidateRemainingResults"] = "result[i] != Math.Abs(firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Abs", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != Math.Abs(firstOp[0])", ["ValidateRemainingResults"] = "result[i] != Math.Abs(firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Abs", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != Math.Abs(firstOp[0])", ["ValidateRemainingResults"] = "result[i] != Math.Abs(firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Abs", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != firstOp[0]", ["ValidateRemainingResults"] = "result[i] != firstOp[i]" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Abs", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != firstOp[0]", ["ValidateRemainingResults"] = "result[i] != firstOp[i]" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Abs", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != firstOp[0]", ["ValidateRemainingResults"] = "result[i] != firstOp[i]" }), + + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Add", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(left[i] + right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Add", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != (double)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (double)(left[i] + right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Add", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (short)(left[i] + right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Add", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (int)(left[i] + right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Add", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (long)(left[i] + right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Add", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(left[i] + right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Add", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != (float)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (float)(left[i] + right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Add", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(left[i] + right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Add", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(left[i] + right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Add", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(left[i] + right[i])" }), + + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "AndNot", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(left[0] & ~right[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(left[i] & ~right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "AndNot", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != (BitConverter.DoubleToInt64Bits(left[0]) & ~BitConverter.DoubleToInt64Bits(right[0]))", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != (BitConverter.DoubleToInt64Bits(left[i]) & ~BitConverter.DoubleToInt64Bits(right[i]))" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "AndNot", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)(left[0] & ~right[0])", ["ValidateRemainingResults"] = "result[i] != (short)(left[i] & ~right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "AndNot", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)(left[0] & ~right[0])", ["ValidateRemainingResults"] = "result[i] != (int)(left[i] & ~right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "AndNot", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)(left[0] & ~right[0])", ["ValidateRemainingResults"] = "result[i] != (long)(left[i] & ~right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "AndNot", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)(left[0] & ~right[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(left[i] & ~right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "AndNot", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != (BitConverter.SingleToInt32Bits(left[0]) & ~BitConverter.SingleToInt32Bits(right[0]))", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != (BitConverter.SingleToInt32Bits(left[i]) & ~BitConverter.SingleToInt32Bits(right[i]))" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "AndNot", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)(left[0] & ~right[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(left[i] & ~right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "AndNot", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)(left[0] & ~right[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(left[i] & ~right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "AndNot", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(left[0] & ~right[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(left[i] & ~right[i])" }), + + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseAnd", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(left[0] & right[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(left[i] & right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseAnd", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != (BitConverter.DoubleToInt64Bits(left[0]) & BitConverter.DoubleToInt64Bits(right[0]))", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != (BitConverter.DoubleToInt64Bits(left[i]) & BitConverter.DoubleToInt64Bits(right[i]))" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseAnd", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)(left[0] & right[0])", ["ValidateRemainingResults"] = "result[i] != (short)(left[i] & right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseAnd", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)(left[0] & right[0])", ["ValidateRemainingResults"] = "result[i] != (int)(left[i] & right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseAnd", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)(left[0] & right[0])", ["ValidateRemainingResults"] = "result[i] != (long)(left[i] & right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseAnd", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)(left[0] & right[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(left[i] & right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseAnd", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != (BitConverter.SingleToInt32Bits(left[0]) & BitConverter.SingleToInt32Bits(right[0]))", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != (BitConverter.SingleToInt32Bits(left[i]) & BitConverter.SingleToInt32Bits(right[i]))" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseAnd", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)(left[0] & right[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(left[i] & right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseAnd", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)(left[0] & right[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(left[i] & right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseAnd", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(left[0] & right[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(left[i] & right[i])" }), + + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseOr", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(left[0] | right[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(left[i] | right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseOr", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != (BitConverter.DoubleToInt64Bits(left[0]) | BitConverter.DoubleToInt64Bits(right[0]))", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != (BitConverter.DoubleToInt64Bits(left[i]) | BitConverter.DoubleToInt64Bits(right[i]))" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseOr", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)(left[0] | right[0])", ["ValidateRemainingResults"] = "result[i] != (short)(left[i] | right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseOr", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)(left[0] | right[0])", ["ValidateRemainingResults"] = "result[i] != (int)(left[i] | right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseOr", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)(left[0] | right[0])", ["ValidateRemainingResults"] = "result[i] != (long)(left[i] | right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseOr", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)(left[0] | right[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(left[i] | right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseOr", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != (BitConverter.SingleToInt32Bits(left[0]) | BitConverter.SingleToInt32Bits(right[0]))", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != (BitConverter.SingleToInt32Bits(left[i]) | BitConverter.SingleToInt32Bits(right[i]))" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseOr", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)(left[0] | right[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(left[i] | right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseOr", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)(left[0] | right[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(left[i] | right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "BitwiseOr", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(left[0] | right[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(left[i] | right[i])" }), + + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Ceiling", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != Math.Ceiling(firstOp[0])", ["ValidateRemainingResults"] = "result[i] != Math.Ceiling(firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Ceiling", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != MathF.Ceiling(firstOp[0])", ["ValidateRemainingResults"] = "result[i] != MathF.Ceiling(firstOp[i])" }), + + ("VectorTernaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ConditionalSelect", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector512", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)((secondOp[0] & firstOp[0]) | (thirdOp[0] & ~firstOp[0]))", ["ValidateRemainingResults"] = "result[i] != (byte)((secondOp[i] & firstOp[i]) | (thirdOp[i] & ~firstOp[i]))" }), + ("VectorTernaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ConditionalSelect", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector512", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != ((BitConverter.DoubleToInt64Bits(secondOp[0]) & BitConverter.DoubleToInt64Bits(firstOp[0])) | (BitConverter.DoubleToInt64Bits(thirdOp[0]) & ~BitConverter.DoubleToInt64Bits(firstOp[0])))", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != ((BitConverter.DoubleToInt64Bits(secondOp[i]) & BitConverter.DoubleToInt64Bits(firstOp[i])) | (BitConverter.DoubleToInt64Bits(thirdOp[i]) & ~BitConverter.DoubleToInt64Bits(firstOp[i])))" }), + ("VectorTernaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ConditionalSelect", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector512", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)((secondOp[0] & firstOp[0]) | (thirdOp[0] & ~firstOp[0]))", ["ValidateRemainingResults"] = "result[i] != (short)((secondOp[i] & firstOp[i]) | (thirdOp[i] & ~firstOp[i]))" }), + ("VectorTernaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ConditionalSelect", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector512", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)((secondOp[0] & firstOp[0]) | (thirdOp[0] & ~firstOp[0]))", ["ValidateRemainingResults"] = "result[i] != (int)((secondOp[i] & firstOp[i]) | (thirdOp[i] & ~firstOp[i]))" }), + ("VectorTernaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ConditionalSelect", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["Op3VectorType"] = "Vector512", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)((secondOp[0] & firstOp[0]) | (thirdOp[0] & ~firstOp[0]))", ["ValidateRemainingResults"] = "result[i] != (long)((secondOp[i] & firstOp[i]) | (thirdOp[i] & ~firstOp[i]))" }), + ("VectorTernaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ConditionalSelect", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector512", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)((secondOp[0] & firstOp[0]) | (thirdOp[0] & ~firstOp[0]))", ["ValidateRemainingResults"] = "result[i] != (sbyte)((secondOp[i] & firstOp[i]) | (thirdOp[i] & ~firstOp[i]))" }), + ("VectorTernaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ConditionalSelect", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector512", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != ((BitConverter.SingleToInt32Bits(secondOp[0]) & BitConverter.SingleToInt32Bits(firstOp[0])) | (BitConverter.SingleToInt32Bits(thirdOp[0]) & ~BitConverter.SingleToInt32Bits(firstOp[0])))", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != ((BitConverter.SingleToInt32Bits(secondOp[i]) & BitConverter.SingleToInt32Bits(firstOp[i])) | (BitConverter.SingleToInt32Bits(thirdOp[i]) & ~BitConverter.SingleToInt32Bits(firstOp[i])))" }), + ("VectorTernaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ConditionalSelect", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector512", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)((secondOp[0] & firstOp[0]) | (thirdOp[0] & ~firstOp[0]))", ["ValidateRemainingResults"] = "result[i] != (ushort)((secondOp[i] & firstOp[i]) | (thirdOp[i] & ~firstOp[i]))" }), + ("VectorTernaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ConditionalSelect", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector512", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)((secondOp[0] & firstOp[0]) | (thirdOp[0] & ~firstOp[0]))", ["ValidateRemainingResults"] = "result[i] != (uint)((secondOp[i] & firstOp[i]) | (thirdOp[i] & ~firstOp[i]))" }), + ("VectorTernaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ConditionalSelect", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["Op3VectorType"] = "Vector512", ["Op3BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)((secondOp[0] & firstOp[0]) | (thirdOp[0] & ~firstOp[0]))", ["ValidateRemainingResults"] = "result[i] != (ulong)((secondOp[i] & firstOp[i]) | (thirdOp[i] & ~firstOp[i]))" }), + + ("VectorConvertToTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ConvertToDouble", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (double)(firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (double)(firstOp[i])" }), + ("VectorConvertToTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ConvertToDouble", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Math.Min(long.MaxValue, TestLibrary.Generator.GetUInt64())", ["ValidateFirstResult"] = "result[0] != (double)(firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (double)(firstOp[i])" }), + ("VectorConvertToTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ConvertToInt32", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != (int)(firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (int)(firstOp[i])" }), + ("VectorConvertToTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ConvertToInt64", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != (long)(firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (long)(firstOp[i])" }), + ("VectorConvertToTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ConvertToSingle", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (float)(firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (float)(firstOp[i])" }), + ("VectorConvertToTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ConvertToSingle", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (float)(firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (float)(firstOp[i])" }), + ("VectorConvertToTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ConvertToUInt32", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != (uint)(firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(firstOp[i])" }), + ("VectorConvertToTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ConvertToUInt64", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != (ulong)(firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(firstOp[i])" }), + + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != expectedValue" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != expectedValue" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != expectedValue" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != expectedValue" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != expectedValue" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != expectedValue" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != expectedValue" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != expectedValue" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != expectedValue" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != expectedValue" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != 0" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != 0" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != 0" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != 0" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != 0" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalar", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != 0" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != 0" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalar", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != 0" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalar", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != 0" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalar", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "resultElements[i] != 0" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalarUnsafe", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "false /* value is uninitialized */" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalarUnsafe", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "false /* value is uninitialized */" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalarUnsafe", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "false /* value is uninitialized */" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalarUnsafe", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "false /* value is uninitialized */" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalarUnsafe", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "false /* value is uninitialized */" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalarUnsafe", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "false /* value is uninitialized */" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalarUnsafe", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "false /* value is uninitialized */" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalarUnsafe", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "false /* value is uninitialized */" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalarUnsafe", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "false /* value is uninitialized */" }), + ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalarUnsafe", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "false /* value is uninitialized */" }), + + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + + ("VectorCreateVectorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["OpVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()" }), + ("VectorCreateVectorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["OpVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()" }), + ("VectorCreateVectorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["OpVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()" }), + ("VectorCreateVectorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["OpVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()" }), + ("VectorCreateVectorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["OpVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()" }), + ("VectorCreateVectorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["OpVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()" }), + ("VectorCreateVectorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["OpVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()" }), + ("VectorCreateVectorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["OpVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()" }), + ("VectorCreateVectorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["OpVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()" }), + ("VectorCreateVectorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["OpVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()" }), + + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Divide", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "Math.Max((byte)(1), TestLibrary.Generator.GetByte())", ["ValidateFirstResult"] = "result[0] != (byte)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(left[i] / right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Divide", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "Math.Max((double)(1), TestLibrary.Generator.GetDouble())", ["ValidateFirstResult"] = "result[0] != (double)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (double)(left[i] / right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Divide", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "Math.Max((short)(1), TestLibrary.Generator.GetInt16())", ["ValidateFirstResult"] = "result[0] != (short)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (short)(left[i] / right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Divide", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "Math.Max((int)(1), TestLibrary.Generator.GetInt32())", ["ValidateFirstResult"] = "result[0] != (int)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (int)(left[i] / right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Divide", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "Math.Max((long)(1), TestLibrary.Generator.GetInt64())", ["ValidateFirstResult"] = "result[0] != (long)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (long)(left[i] / right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Divide", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "Math.Max((sbyte)(1), TestLibrary.Generator.GetSByte())", ["ValidateFirstResult"] = "result[0] != (sbyte)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(left[i] / right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Divide", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "Math.Max((float)(1), TestLibrary.Generator.GetSingle())", ["ValidateFirstResult"] = "result[0] != (float)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (float)(left[i] / right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Divide", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "Math.Max((ushort)(1), TestLibrary.Generator.GetUInt16())", ["ValidateFirstResult"] = "result[0] != (ushort)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(left[i] / right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Divide", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "Math.Max((uint)(1), TestLibrary.Generator.GetUInt32())", ["ValidateFirstResult"] = "result[0] != (uint)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(left[i] / right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Divide", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "Math.Max((ulong)(1), TestLibrary.Generator.GetUInt64())", ["ValidateFirstResult"] = "result[0] != (ulong)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(left[i] / right[i])" }), + + ("VectorDotTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Dot", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()" }), + ("VectorDotTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Dot", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()" }), + ("VectorDotTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Dot", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()" }), + ("VectorDotTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Dot", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()" }), + ("VectorDotTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Dot", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()" }), + ("VectorDotTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Dot", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()" }), + ("VectorDotTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Dot", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()" }), + ("VectorDotTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Dot", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()" }), + ("VectorDotTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Dot", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()" }), + ("VectorDotTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Dot", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()" }), + + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "EqualsAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Equals", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != ((left[0] == right[0]) ? byte.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] == right[i]) ? byte.MaxValue : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Equals", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != ((left[0] == right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != ((left[i] == right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Equals", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != ((left[0] == right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] == right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Equals", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != ((left[0] == right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] == right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Equals", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != ((left[0] == right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] == right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Equals", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != ((left[0] == right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] == right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Equals", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != ((left[0] == right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != ((left[i] == right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Equals", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != ((left[0] == right[0]) ? ushort.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] == right[i]) ? ushort.MaxValue : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Equals", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != ((left[0] == right[0]) ? uint.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] == right[i]) ? uint.MaxValue : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Equals", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != ((left[0] == right[0]) ? ulong.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] == right[i]) ? ulong.MaxValue : 0)" }), + + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Floor", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != Math.Floor(firstOp[0])", ["ValidateRemainingResults"] = "result[i] != Math.Floor(firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Floor", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != MathF.Floor(firstOp[0])", ["ValidateRemainingResults"] = "result[i] != MathF.Floor(firstOp[i])" }), + + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "left[i] > right[i]" }), + + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != ((left[0] > right[0]) ? byte.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] > right[i]) ? byte.MaxValue : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != ((left[0] > right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != ((left[i] > right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != ((left[0] > right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] > right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != ((left[0] > right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] > right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != ((left[0] > right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] > right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != ((left[0] > right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] > right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != ((left[0] > right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != ((left[i] > right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != ((left[0] > right[0]) ? ushort.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] > right[i]) ? ushort.MaxValue : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != ((left[0] > right[0]) ? uint.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] > right[i]) ? uint.MaxValue : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != ((left[0] > right[0]) ? ulong.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] > right[i]) ? ulong.MaxValue : 0)" }), + + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "left[i] >= right[i]" }), + + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != ((left[0] >= right[0]) ? byte.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] >= right[i]) ? byte.MaxValue : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != ((left[0] >= right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != ((left[i] >= right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != ((left[0] >= right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] >= right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != ((left[0] >= right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] >= right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != ((left[0] >= right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] >= right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != ((left[0] >= right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] >= right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != ((left[0] >= right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != ((left[i] >= right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != ((left[0] >= right[0]) ? ushort.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] >= right[i]) ? ushort.MaxValue : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != ((left[0] >= right[0]) ? uint.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] >= right[i]) ? uint.MaxValue : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GreaterThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != ((left[0] >= right[0]) ? ulong.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] >= right[i]) ? ulong.MaxValue : 0)" }), + + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "left[i] < right[i]" }), + + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != ((left[0] < right[0]) ? byte.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] < right[i]) ? byte.MaxValue : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != ((left[0] < right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != ((left[i] < right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != ((left[0] < right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] < right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != ((left[0] < right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] < right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != ((left[0] < right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] < right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != ((left[0] < right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] < right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != ((left[0] < right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != ((left[i] < right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != ((left[0] < right[0]) ? ushort.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] < right[i]) ? ushort.MaxValue : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != ((left[0] < right[0]) ? uint.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] < right[i]) ? uint.MaxValue : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThan", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != ((left[0] < right[0]) ? ulong.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] < right[i]) ? ulong.MaxValue : 0)" }), + + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + ("VectorBooleanAllBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAll", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + ("VectorBooleanAnyBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqualAny", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "left[i] <= right[i]" }), + + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != ((left[0] <= right[0]) ? byte.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] <= right[i]) ? byte.MaxValue : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != ((left[0] <= right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != ((left[i] <= right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != ((left[0] <= right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] <= right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != ((left[0] <= right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] <= right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != ((left[0] <= right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] <= right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != ((left[0] <= right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] <= right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != ((left[0] <= right[0]) ? -1 : 0)", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != ((left[i] <= right[i]) ? -1 : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != ((left[0] <= right[0]) ? ushort.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] <= right[i]) ? ushort.MaxValue : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != ((left[0] <= right[0]) ? uint.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] <= right[i]) ? uint.MaxValue : 0)" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "LessThanOrEqual", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != ((left[0] <= right[0]) ? ulong.MaxValue : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] <= right[i]) ? ulong.MaxValue : 0)" }), + + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Max", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != ((left[0] > right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] > right[i]) ? left[i] : right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Max", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != ((left[0] > right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] > right[i]) ? left[i] : right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Max", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != ((left[0] > right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] > right[i]) ? left[i] : right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Max", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != ((left[0] > right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] > right[i]) ? left[i] : right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Max", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != ((left[0] > right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] > right[i]) ? left[i] : right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Max", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != ((left[0] > right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] > right[i]) ? left[i] : right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Max", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != ((left[0] > right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] > right[i]) ? left[i] : right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Max", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != ((left[0] > right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] > right[i]) ? left[i] : right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Max", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != ((left[0] > right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] > right[i]) ? left[i] : right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Max", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != ((left[0] > right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] > right[i]) ? left[i] : right[i])" }), + + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Min", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != ((left[0] < right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] < right[i]) ? left[i] : right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Min", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != ((left[0] < right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] < right[i]) ? left[i] : right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Min", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != ((left[0] < right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] < right[i]) ? left[i] : right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Min", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != ((left[0] < right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] < right[i]) ? left[i] : right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Min", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != ((left[0] < right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] < right[i]) ? left[i] : right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Min", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != ((left[0] < right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] < right[i]) ? left[i] : right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Min", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != ((left[0] < right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] < right[i]) ? left[i] : right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Min", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != ((left[0] < right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] < right[i]) ? left[i] : right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Min", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != ((left[0] < right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] < right[i]) ? left[i] : right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Min", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != ((left[0] < right[0]) ? left[0] : right[0])", ["ValidateRemainingResults"] = "result[i] != ((left[i] < right[i]) ? left[i] : right[i])" }), + + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Multiply", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(left[i] * right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Multiply", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != (double)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (double)(left[i] * right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Multiply", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (short)(left[i] * right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Multiply", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (int)(left[i] * right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Multiply", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (long)(left[i] * right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Multiply", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(left[i] * right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Multiply", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != (float)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (float)(left[i] * right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Multiply", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(left[i] * right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Multiply", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(left[i] * right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Multiply", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(left[i] * right[i])" }), + + ("VectorNarrowTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Narrow", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != (float)(left[0])", ["ValidateRemainingResults"] = "result[i] != (float)((i < Op1ElementCount) ? left[i] : right[i - Op1ElementCount])" }), + ("VectorNarrowTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Narrow", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (sbyte)(left[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)((i < Op1ElementCount) ? left[i] : right[i - Op1ElementCount])" }), + ("VectorNarrowTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Narrow", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (short)(left[0])", ["ValidateRemainingResults"] = "result[i] != (short)((i < Op1ElementCount) ? left[i] : right[i - Op1ElementCount])" }), + ("VectorNarrowTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Narrow", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (int)(left[0])", ["ValidateRemainingResults"] = "result[i] != (int)((i < Op1ElementCount) ? left[i] : right[i - Op1ElementCount])" }), + ("VectorNarrowTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Narrow", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (byte)(left[0])", ["ValidateRemainingResults"] = "result[i] != (byte)((i < Op1ElementCount) ? left[i] : right[i - Op1ElementCount])" }), + ("VectorNarrowTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Narrow", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (ushort)(left[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)((i < Op1ElementCount) ? left[i] : right[i - Op1ElementCount])" }), + ("VectorNarrowTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Narrow", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (uint)(left[0])", ["ValidateRemainingResults"] = "result[i] != (uint)((i < Op1ElementCount) ? left[i] : right[i - Op1ElementCount])" }), + + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Negate", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(0 - firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Negate", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != (double)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (double)(0 - firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Negate", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (short)(0 - firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Negate", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (int)(0 - firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Negate", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (long)(0 - firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Negate", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(0 - firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Negate", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != (float)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (float)(0 - firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Negate", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(0 - firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Negate", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(0 - firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Negate", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(0 - firstOp[i])" }), + + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "OnesComplement", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(~firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(~firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "OnesComplement", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != ~BitConverter.DoubleToInt64Bits(firstOp[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != ~BitConverter.DoubleToInt64Bits(firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "OnesComplement", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)(~firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (short)(~firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "OnesComplement", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)(~firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (int)(~firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "OnesComplement", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)(~firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (long)(~firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "OnesComplement", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)(~firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(~firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "OnesComplement", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != ~BitConverter.SingleToInt32Bits(firstOp[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != ~BitConverter.SingleToInt32Bits(firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "OnesComplement", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)(~firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(~firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "OnesComplement", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)(~firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(~firstOp[i])" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "OnesComplement", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(~firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(~firstOp[i])" }), + + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Sqrt", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(MathF.Sqrt(firstOp[0]))", ["ValidateRemainingResults"] = "result[i] != (byte)(MathF.Sqrt(firstOp[i]))" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Sqrt", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != (double)(Math.Sqrt(firstOp[0]))", ["ValidateRemainingResults"] = "result[i] != (double)(Math.Sqrt(firstOp[i]))" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Sqrt", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)(MathF.Sqrt(firstOp[0]))", ["ValidateRemainingResults"] = "result[i] != (short)(MathF.Sqrt(firstOp[i]))" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Sqrt", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)(Math.Sqrt(firstOp[0]))", ["ValidateRemainingResults"] = "result[i] != (int)(Math.Sqrt(firstOp[i]))" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Sqrt", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)(Math.Sqrt(firstOp[0]))", ["ValidateRemainingResults"] = "result[i] != (long)(Math.Sqrt(firstOp[i]))" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Sqrt", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)(MathF.Sqrt(firstOp[0]))", ["ValidateRemainingResults"] = "result[i] != (sbyte)(MathF.Sqrt(firstOp[i]))" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Sqrt", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != (float)(MathF.Sqrt(firstOp[0]))", ["ValidateRemainingResults"] = "result[i] != (float)(MathF.Sqrt(firstOp[i]))" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Sqrt", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)(MathF.Sqrt(firstOp[0]))", ["ValidateRemainingResults"] = "result[i] != (ushort)(MathF.Sqrt(firstOp[i]))" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Sqrt", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)(Math.Sqrt(firstOp[0]))", ["ValidateRemainingResults"] = "result[i] != (uint)(Math.Sqrt(firstOp[i]))" }), + ("VectorUnaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Sqrt", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(Math.Sqrt(firstOp[0]))", ["ValidateRemainingResults"] = "result[i] != (ulong)(Math.Sqrt(firstOp[i]))" }), + + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Subtract", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(left[i] - right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Subtract", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != (double)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (double)(left[i] - right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Subtract", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (short)(left[i] - right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Subtract", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (int)(left[i] - right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Subtract", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (long)(left[i] - right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Subtract", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(left[i] - right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Subtract", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != (float)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (float)(left[i] - right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Subtract", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(left[i] - right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Subtract", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(left[i] - right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Subtract", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(left[i] - right[i])" }), + + ("VectorWidenTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Widen", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateLowerResult"] = "lowerResult[i] != (ushort)(firstOp[i])", ["ValidateUpperResult"] = "upperResult[i] != (ushort)(firstOp[i + RetElementCount])" }), + ("VectorWidenTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Widen", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateLowerResult"] = "lowerResult[i] != (int)(firstOp[i])", ["ValidateUpperResult"] = "upperResult[i] != (int)(firstOp[i + RetElementCount])" }), + ("VectorWidenTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Widen", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateLowerResult"] = "lowerResult[i] != (long)(firstOp[i])", ["ValidateUpperResult"] = "upperResult[i] != (long)(firstOp[i + RetElementCount])" }), + ("VectorWidenTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Widen", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateLowerResult"] = "lowerResult[i] != (short)(firstOp[i])", ["ValidateUpperResult"] = "upperResult[i] != (short)(firstOp[i + RetElementCount])" }), + ("VectorWidenTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Widen", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateLowerResult"] = "lowerResult[i] != (double)(firstOp[i])", ["ValidateUpperResult"] = "upperResult[i] != (double)(firstOp[i + RetElementCount])" }), + ("VectorWidenTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Widen", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateLowerResult"] = "lowerResult[i] != (uint)(firstOp[i])", ["ValidateUpperResult"] = "upperResult[i] != (uint)(firstOp[i + RetElementCount])" }), + ("VectorWidenTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Widen", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateLowerResult"] = "lowerResult[i] != (ulong)(firstOp[i])", ["ValidateUpperResult"] = "upperResult[i] != (ulong)(firstOp[i + RetElementCount])" }), + + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Xor", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(left[0] ^ right[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(left[i] ^ right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Xor", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != (BitConverter.DoubleToInt64Bits(left[0]) ^ BitConverter.DoubleToInt64Bits(right[0]))", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != (BitConverter.DoubleToInt64Bits(left[i]) ^ BitConverter.DoubleToInt64Bits(right[i]))" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Xor", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)(left[0] ^ right[0])", ["ValidateRemainingResults"] = "result[i] != (short)(left[i] ^ right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Xor", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)(left[0] ^ right[0])", ["ValidateRemainingResults"] = "result[i] != (int)(left[i] ^ right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Xor", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)(left[0] ^ right[0])", ["ValidateRemainingResults"] = "result[i] != (long)(left[i] ^ right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Xor", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)(left[0] ^ right[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(left[i] ^ right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Xor", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != (BitConverter.SingleToInt32Bits(left[0]) ^ BitConverter.SingleToInt32Bits(right[0]))", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != (BitConverter.SingleToInt32Bits(left[i]) ^ BitConverter.SingleToInt32Bits(right[i]))" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Xor", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)(left[0] ^ right[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(left[i] ^ right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Xor", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)(left[0] ^ right[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(left[i] ^ right[i])" }), + ("VectorBinaryOpTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Xor", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(left[0] ^ right[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(left[i] ^ right[i])" }), +}; + +private static readonly (string templateFileName, Dictionary templateData)[] Vector512_1Inputs = new [] +{ + ("VectorZeroTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "Zero", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64" }), + ("VectorZeroTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "Zero", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64" }), + ("VectorZeroTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "Zero", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64" }), + ("VectorZeroTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "Zero", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64" }), + ("VectorZeroTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "Zero", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64" }), + ("VectorZeroTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "Zero", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64" }), + ("VectorZeroTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "Zero", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64" }), + ("VectorZeroTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "Zero", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64" }), + ("VectorZeroTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "Zero", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64" }), + ("VectorZeroTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "Zero", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64" }), + + ("VectorAllBitsSetTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AllBitsSet", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64" }), + ("VectorAllBitsSetTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AllBitsSet", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64" }), + ("VectorAllBitsSetTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AllBitsSet", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64" }), + ("VectorAllBitsSetTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AllBitsSet", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64" }), + ("VectorAllBitsSetTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AllBitsSet", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64" }), + ("VectorAllBitsSetTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AllBitsSet", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64" }), + ("VectorAllBitsSetTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AllBitsSet", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64" }), + ("VectorAllBitsSetTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AllBitsSet", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64" }), + ("VectorAllBitsSetTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AllBitsSet", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64" }), + ("VectorAllBitsSetTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AllBitsSet", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64" }), + + + ("VectorAsTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "As", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(byte)TestLibrary.Generator.GetByte()" }), + ("VectorAsTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "As", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(double)TestLibrary.Generator.GetDouble()" }), + ("VectorAsTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "As", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(short)TestLibrary.Generator.GetInt16()" }), + ("VectorAsTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "As", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(int)TestLibrary.Generator.GetInt32()" }), + ("VectorAsTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "As", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(long)TestLibrary.Generator.GetInt64()" }), + ("VectorAsTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "As", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(sbyte)TestLibrary.Generator.GetSByte()" }), + ("VectorAsTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "As", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(float)TestLibrary.Generator.GetSingle()" }), + ("VectorAsTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "As", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(ushort)TestLibrary.Generator.GetUInt16()" }), + ("VectorAsTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "As", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(uint)TestLibrary.Generator.GetUInt32()" }), + ("VectorAsTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "As", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(ulong)TestLibrary.Generator.GetUInt64()" }), + + ("VectorAsNumericsVectorTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AsVector", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(byte)TestLibrary.Generator.GetByte()" }), + ("VectorAsNumericsVectorTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AsVector", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(double)TestLibrary.Generator.GetDouble()" }), + ("VectorAsNumericsVectorTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AsVector", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(short)TestLibrary.Generator.GetInt16()" }), + ("VectorAsNumericsVectorTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AsVector", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(int)TestLibrary.Generator.GetInt32()" }), + ("VectorAsNumericsVectorTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AsVector", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(long)TestLibrary.Generator.GetInt64()" }), + ("VectorAsNumericsVectorTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AsVector", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(sbyte)TestLibrary.Generator.GetSByte()" }), + ("VectorAsNumericsVectorTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AsVector", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(float)TestLibrary.Generator.GetSingle()" }), + ("VectorAsNumericsVectorTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AsVector", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(ushort)TestLibrary.Generator.GetUInt16()" }), + ("VectorAsNumericsVectorTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AsVector", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(uint)TestLibrary.Generator.GetUInt32()" }), + ("VectorAsNumericsVectorTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AsVector", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(ulong)TestLibrary.Generator.GetUInt64()" }), + + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "15", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "31", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "15", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "15", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "31", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "15", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Addition", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(left[i] + right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Addition", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != (double)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (double)(left[i] + right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Addition", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (short)(left[i] + right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Addition", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (int)(left[i] + right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Addition", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (long)(left[i] + right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Addition", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(left[i] + right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Addition", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != (float)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (float)(left[i] + right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Addition", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(left[i] + right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Addition", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(left[i] + right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Addition", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(left[i] + right[i])" }), + + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseAnd", ["Opcode"] = "&", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(left[0] & right[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(left[i] & right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseAnd", ["Opcode"] = "&", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != (BitConverter.DoubleToInt64Bits(left[0]) & BitConverter.DoubleToInt64Bits(right[0]))", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != (BitConverter.DoubleToInt64Bits(left[i]) & BitConverter.DoubleToInt64Bits(right[i]))" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseAnd", ["Opcode"] = "&", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)(left[0] & right[0])", ["ValidateRemainingResults"] = "result[i] != (short)(left[i] & right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseAnd", ["Opcode"] = "&", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)(left[0] & right[0])", ["ValidateRemainingResults"] = "result[i] != (int)(left[i] & right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseAnd", ["Opcode"] = "&", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)(left[0] & right[0])", ["ValidateRemainingResults"] = "result[i] != (long)(left[i] & right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseAnd", ["Opcode"] = "&", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)(left[0] & right[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(left[i] & right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseAnd", ["Opcode"] = "&", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != (BitConverter.SingleToInt32Bits(left[0]) & BitConverter.SingleToInt32Bits(right[0]))", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != (BitConverter.SingleToInt32Bits(left[i]) & BitConverter.SingleToInt32Bits(right[i]))" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseAnd", ["Opcode"] = "&", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)(left[0] & right[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(left[i] & right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseAnd", ["Opcode"] = "&", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)(left[0] & right[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(left[i] & right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseAnd", ["Opcode"] = "&", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(left[0] & right[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(left[i] & right[i])" }), + + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseOr", ["Opcode"] = "|", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(left[0] | right[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(left[i] | right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseOr", ["Opcode"] = "|", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != (BitConverter.DoubleToInt64Bits(left[0]) | BitConverter.DoubleToInt64Bits(right[0]))", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != (BitConverter.DoubleToInt64Bits(left[i]) | BitConverter.DoubleToInt64Bits(right[i]))" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseOr", ["Opcode"] = "|", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)(left[0] | right[0])", ["ValidateRemainingResults"] = "result[i] != (short)(left[i] | right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseOr", ["Opcode"] = "|", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)(left[0] | right[0])", ["ValidateRemainingResults"] = "result[i] != (int)(left[i] | right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseOr", ["Opcode"] = "|", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)(left[0] | right[0])", ["ValidateRemainingResults"] = "result[i] != (long)(left[i] | right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseOr", ["Opcode"] = "|", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)(left[0] | right[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(left[i] | right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseOr", ["Opcode"] = "|", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != (BitConverter.SingleToInt32Bits(left[0]) | BitConverter.SingleToInt32Bits(right[0]))", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != (BitConverter.SingleToInt32Bits(left[i]) | BitConverter.SingleToInt32Bits(right[i]))" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseOr", ["Opcode"] = "|", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)(left[0] | right[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(left[i] | right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseOr", ["Opcode"] = "|", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)(left[0] | right[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(left[i] | right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_BitwiseOr", ["Opcode"] = "|", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(left[0] | right[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(left[i] | right[i])" }), + + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Division", ["Opcode"] = "/", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "Math.Max((byte)(1), TestLibrary.Generator.GetByte())", ["ValidateFirstResult"] = "result[0] != (byte)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(left[i] / right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Division", ["Opcode"] = "/", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "Math.Max((double)(1), TestLibrary.Generator.GetDouble())", ["ValidateFirstResult"] = "result[0] != (double)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (double)(left[i] / right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Division", ["Opcode"] = "/", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "Math.Max((short)(1), TestLibrary.Generator.GetInt16())", ["ValidateFirstResult"] = "result[0] != (short)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (short)(left[i] / right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Division", ["Opcode"] = "/", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "Math.Max((int)(1), TestLibrary.Generator.GetInt32())", ["ValidateFirstResult"] = "result[0] != (int)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (int)(left[i] / right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Division", ["Opcode"] = "/", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "Math.Max((long)(1), TestLibrary.Generator.GetInt64())", ["ValidateFirstResult"] = "result[0] != (long)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (long)(left[i] / right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Division", ["Opcode"] = "/", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "Math.Max((sbyte)(1), TestLibrary.Generator.GetSByte())", ["ValidateFirstResult"] = "result[0] != (sbyte)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(left[i] / right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Division", ["Opcode"] = "/", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "Math.Max((float)(1), TestLibrary.Generator.GetSingle())", ["ValidateFirstResult"] = "result[0] != (float)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (float)(left[i] / right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Division", ["Opcode"] = "/", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "Math.Max((ushort)(1), TestLibrary.Generator.GetUInt16())", ["ValidateFirstResult"] = "result[0] != (ushort)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(left[i] / right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Division", ["Opcode"] = "/", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "Math.Max((uint)(1), TestLibrary.Generator.GetUInt32())", ["ValidateFirstResult"] = "result[0] != (uint)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(left[i] / right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Division", ["Opcode"] = "/", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "Math.Max((ulong)(1), TestLibrary.Generator.GetUInt64())", ["ValidateFirstResult"] = "result[0] != (ulong)(left[0] / right[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(left[i] / right[i])" }), + + ("VectorBooleanAllBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Equality", ["Opcode"] = "==", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAllBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Equality", ["Opcode"] = "==", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAllBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Equality", ["Opcode"] = "==", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAllBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Equality", ["Opcode"] = "==", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAllBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Equality", ["Opcode"] = "==", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAllBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Equality", ["Opcode"] = "==", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAllBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Equality", ["Opcode"] = "==", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAllBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Equality", ["Opcode"] = "==", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAllBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Equality", ["Opcode"] = "==", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + ("VectorBooleanAllBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Equality", ["Opcode"] = "==", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "left[i] == right[i]" }), + + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_ExclusiveOr", ["Opcode"] = "^", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(left[0] ^ right[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(left[i] ^ right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_ExclusiveOr", ["Opcode"] = "^", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != (BitConverter.DoubleToInt64Bits(left[0]) ^ BitConverter.DoubleToInt64Bits(right[0]))", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != (BitConverter.DoubleToInt64Bits(left[i]) ^ BitConverter.DoubleToInt64Bits(right[i]))" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_ExclusiveOr", ["Opcode"] = "^", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)(left[0] ^ right[0])", ["ValidateRemainingResults"] = "result[i] != (short)(left[i] ^ right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_ExclusiveOr", ["Opcode"] = "^", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)(left[0] ^ right[0])", ["ValidateRemainingResults"] = "result[i] != (int)(left[i] ^ right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_ExclusiveOr", ["Opcode"] = "^", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)(left[0] ^ right[0])", ["ValidateRemainingResults"] = "result[i] != (long)(left[i] ^ right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_ExclusiveOr", ["Opcode"] = "^", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)(left[0] ^ right[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(left[i] ^ right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_ExclusiveOr", ["Opcode"] = "^", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != (BitConverter.SingleToInt32Bits(left[0]) ^ BitConverter.SingleToInt32Bits(right[0]))", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != (BitConverter.SingleToInt32Bits(left[i]) ^ BitConverter.SingleToInt32Bits(right[i]))" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_ExclusiveOr", ["Opcode"] = "^", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)(left[0] ^ right[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(left[i] ^ right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_ExclusiveOr", ["Opcode"] = "^", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)(left[0] ^ right[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(left[i] ^ right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_ExclusiveOr", ["Opcode"] = "^", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(left[0] ^ right[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(left[i] ^ right[i])" }), + + ("VectorBooleanAnyBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Inequality", ["Opcode"] = "!=", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "left[i] != right[i]" }), + ("VectorBooleanAnyBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Inequality", ["Opcode"] = "!=", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "left[i] != right[i]" }), + ("VectorBooleanAnyBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Inequality", ["Opcode"] = "!=", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "left[i] != right[i]" }), + ("VectorBooleanAnyBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Inequality", ["Opcode"] = "!=", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "left[i] != right[i]" }), + ("VectorBooleanAnyBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Inequality", ["Opcode"] = "!=", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "left[i] != right[i]" }), + ("VectorBooleanAnyBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Inequality", ["Opcode"] = "!=", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "left[i] != right[i]" }), + ("VectorBooleanAnyBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Inequality", ["Opcode"] = "!=", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "left[i] != right[i]" }), + ("VectorBooleanAnyBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Inequality", ["Opcode"] = "!=", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "left[i] != right[i]" }), + ("VectorBooleanAnyBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Inequality", ["Opcode"] = "!=", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "left[i] != right[i]" }), + ("VectorBooleanAnyBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Inequality", ["Opcode"] = "!=", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "left[i] != right[i]" }), + + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Multiply", ["Opcode"] = "*", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(left[i] * right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Multiply", ["Opcode"] = "*", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != (double)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (double)(left[i] * right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Multiply", ["Opcode"] = "*", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (short)(left[i] * right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Multiply", ["Opcode"] = "*", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (int)(left[i] * right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Multiply", ["Opcode"] = "*", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (long)(left[i] * right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Multiply", ["Opcode"] = "*", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(left[i] * right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Multiply", ["Opcode"] = "*", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != (float)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (float)(left[i] * right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Multiply", ["Opcode"] = "*", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(left[i] * right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Multiply", ["Opcode"] = "*", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(left[i] * right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Multiply", ["Opcode"] = "*", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(left[0] * right[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(left[i] * right[i])" }), + + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_OnesComplement", ["Opcode"] = "~", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(~firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(~firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_OnesComplement", ["Opcode"] = "~", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != ~BitConverter.DoubleToInt64Bits(firstOp[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != ~BitConverter.DoubleToInt64Bits(firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_OnesComplement", ["Opcode"] = "~", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)(~firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (short)(~firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_OnesComplement", ["Opcode"] = "~", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)(~firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (int)(~firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_OnesComplement", ["Opcode"] = "~", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)(~firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (long)(~firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_OnesComplement", ["Opcode"] = "~", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)(~firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(~firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_OnesComplement", ["Opcode"] = "~", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != ~BitConverter.SingleToInt32Bits(firstOp[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != ~BitConverter.SingleToInt32Bits(firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_OnesComplement", ["Opcode"] = "~", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)(~firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(~firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_OnesComplement", ["Opcode"] = "~", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)(~firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(~firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_OnesComplement", ["Opcode"] = "~", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(~firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(~firstOp[i])" }), + + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Subtraction", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(left[i] - right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Subtraction", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != (double)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (double)(left[i] - right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Subtraction", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (short)(left[i] - right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Subtraction", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (int)(left[i] - right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Subtraction", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (long)(left[i] - right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Subtraction", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(left[i] - right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Subtraction", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != (float)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (float)(left[i] - right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Subtraction", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(left[i] - right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Subtraction", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(left[i] - right[i])" }), + ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Subtraction", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(left[0] - right[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(left[i] - right[i])" }), + + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryNegation", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(0 - firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryNegation", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != (double)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (double)(0 - firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryNegation", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (short)(0 - firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryNegation", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (int)(0 - firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryNegation", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (long)(0 - firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryNegation", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(0 - firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryNegation", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != (float)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (float)(0 - firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryNegation", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(0 - firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryNegation", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(0 - firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryNegation", ["Opcode"] = "-", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(0 - firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(0 - firstOp[i])" }), + + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryPlus", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(+firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(+firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryPlus", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != (double)(+firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (double)(+firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryPlus", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != (short)(+firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (short)(+firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryPlus", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != (int)(+firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (int)(+firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryPlus", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != (long)(+firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (long)(+firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryPlus", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != (sbyte)(+firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (sbyte)(+firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryPlus", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != (float)(+firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (float)(+firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryPlus", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != (ushort)(+firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (ushort)(+firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryPlus", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != (uint)(+firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (uint)(+firstOp[i])" }), + ("VectorUnaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_UnaryPlus", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != (ulong)(+firstOp[0])", ["ValidateRemainingResults"] = "result[i] != (ulong)(+firstOp[i])" }), +}; + private static readonly (string templateFileName, Dictionary templateData)[] NotSupportedInputs = new [] { ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector64BooleanZero", ["TargetType"] = "Vector64", ["Source"] = "Vector64", ["Method"] = "Zero" }), @@ -2149,6 +2828,52 @@ private static readonly (string templateFileName, Dictionary tem ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector256BooleanWithUpper", ["TargetType"] = "Vector256", ["Source"] = "default(Vector256)", ["Method"] = "WithUpper(default(Vector128))" }), ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector256BooleanToScalar", ["TargetType"] = "bool", ["Source"] = "default(Vector256)", ["Method"] = "ToScalar()" }), ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector256BooleanToString", ["TargetType"] = "string", ["Source"] = "default(Vector256)", ["Method"] = "ToString()" }), + + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanZero", ["TargetType"] = "Vector512", ["Source"] = "Vector512", ["Method"] = "Zero" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAllBitsSet", ["TargetType"] = "Vector512", ["Source"] = "Vector512", ["Method"] = "AllBitsSet" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsGeneric_Boolean", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512ByteAsGeneric_Boolean", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512DoubleAsGeneric_Boolean", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512Int16AsGeneric_Boolean", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512Int32AsGeneric_Boolean", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512Int64AsGeneric_Boolean", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512SByteAsGeneric_Boolean", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512SingleAsGeneric_Boolean", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512UInt16AsGeneric_Boolean", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512UInt32AsGeneric_Boolean", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512UInt64AsGeneric_Boolean", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsGeneric_Byte", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsGeneric_Double", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsGeneric_Int16", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsGeneric_Int32", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsGeneric_Int64", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsGeneric_SByte", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsGeneric_Single", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsGeneric_UInt16", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsGeneric_UInt32", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsGeneric_UInt64", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "As()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsByte", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "AsByte()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsDouble", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "AsDouble()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsInt16", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "AsInt16()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsInt32", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "AsInt32()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsInt64", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "AsInt64()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsSByte", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "AsSByte()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsSingle", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "AsSingle()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsUInt16", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "AsUInt16()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsUInt32", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "AsUInt32()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanAsUInt64", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "AsUInt64()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanGetElementNegativeOne", ["TargetType"] = "bool", ["Source"] = "default(Vector512)", ["Method"] = "GetElement(-1)" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanGetElement0", ["TargetType"] = "bool", ["Source"] = "default(Vector512)", ["Method"] = "GetElement(0)" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanGetElementMaxValue", ["TargetType"] = "bool", ["Source"] = "default(Vector512)", ["Method"] = "GetElement(int.MaxValue)" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanWithElementNegativeOne", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "WithElement(-1, false)" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanWithElement0", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "WithElement(0, false)" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanWithElementMaxValue", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "WithElement(int.MaxValue, false)" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanGetLower", ["TargetType"] = "Vector256", ["Source"] = "default(Vector512)", ["Method"] = "GetLower()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanWithLower", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "WithLower(default(Vector256))" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanGetUpper", ["TargetType"] = "Vector256", ["Source"] = "default(Vector512)", ["Method"] = "GetUpper()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanWithUpper", ["TargetType"] = "Vector512", ["Source"] = "default(Vector512)", ["Method"] = "WithUpper(default(Vector256))" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanToScalar", ["TargetType"] = "bool", ["Source"] = "default(Vector512)", ["Method"] = "ToScalar()" }), + ("VectorNotSupportedTest.template", new Dictionary { ["Isa"] = "NotSupported", ["Name"] = "Vector512BooleanToString", ["TargetType"] = "string", ["Source"] = "default(Vector512)", ["Method"] = "ToString()" }), }; private static void ProcessInputs(string groupName, (string templateFileName, Dictionary templateData)[] inputs) @@ -2278,4 +3003,6 @@ ProcessInputs("Vector128", Vector128Inputs); ProcessInputs("Vector128_1", Vector128_1Inputs); ProcessInputs("Vector256", Vector256Inputs); ProcessInputs("Vector256_1", Vector256_1Inputs); +ProcessInputs("Vector512", Vector512Inputs); +ProcessInputs("Vector512_1", Vector512_1Inputs); ProcessInputs("NotSupported", NotSupportedInputs); From 6ed67580526900c2ead8578da9cdf3e9d716e87f Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Fri, 11 Nov 2022 12:30:09 -0800 Subject: [PATCH 06/26] Generate the Vector512 tests --- .../NotSupported/NotSupported_r.csproj | 45 ++ .../NotSupported/NotSupported_ro.csproj | 45 ++ .../Vector512BooleanAllBitsSet.cs | 44 ++ .../NotSupported/Vector512BooleanAsByte.cs | 44 ++ .../NotSupported/Vector512BooleanAsDouble.cs | 44 ++ .../Vector512BooleanAsGeneric_Boolean.cs | 44 ++ .../Vector512BooleanAsGeneric_Byte.cs | 44 ++ .../Vector512BooleanAsGeneric_Double.cs | 44 ++ .../Vector512BooleanAsGeneric_Int16.cs | 44 ++ .../Vector512BooleanAsGeneric_Int32.cs | 44 ++ .../Vector512BooleanAsGeneric_Int64.cs | 44 ++ .../Vector512BooleanAsGeneric_SByte.cs | 44 ++ .../Vector512BooleanAsGeneric_Single.cs | 44 ++ .../Vector512BooleanAsGeneric_UInt16.cs | 44 ++ .../Vector512BooleanAsGeneric_UInt32.cs | 44 ++ .../Vector512BooleanAsGeneric_UInt64.cs | 44 ++ .../NotSupported/Vector512BooleanAsInt16.cs | 44 ++ .../NotSupported/Vector512BooleanAsInt32.cs | 44 ++ .../NotSupported/Vector512BooleanAsInt64.cs | 44 ++ .../NotSupported/Vector512BooleanAsSByte.cs | 44 ++ .../NotSupported/Vector512BooleanAsSingle.cs | 44 ++ .../NotSupported/Vector512BooleanAsUInt16.cs | 44 ++ .../NotSupported/Vector512BooleanAsUInt32.cs | 44 ++ .../NotSupported/Vector512BooleanAsUInt64.cs | 44 ++ .../Vector512BooleanGetElement0.cs | 44 ++ .../Vector512BooleanGetElementMaxValue.cs | 44 ++ .../Vector512BooleanGetElementNegativeOne.cs | 44 ++ .../NotSupported/Vector512BooleanGetLower.cs | 44 ++ .../NotSupported/Vector512BooleanGetUpper.cs | 44 ++ .../NotSupported/Vector512BooleanToScalar.cs | 44 ++ .../NotSupported/Vector512BooleanToString.cs | 44 ++ .../Vector512BooleanWithElement0.cs | 44 ++ .../Vector512BooleanWithElementMaxValue.cs | 44 ++ .../Vector512BooleanWithElementNegativeOne.cs | 44 ++ .../NotSupported/Vector512BooleanWithLower.cs | 44 ++ .../NotSupported/Vector512BooleanWithUpper.cs | 44 ++ .../NotSupported/Vector512BooleanZero.cs | 44 ++ .../Vector512ByteAsGeneric_Boolean.cs | 44 ++ .../Vector512DoubleAsGeneric_Boolean.cs | 44 ++ .../Vector512Int16AsGeneric_Boolean.cs | 44 ++ .../Vector512Int32AsGeneric_Boolean.cs | 44 ++ .../Vector512Int64AsGeneric_Boolean.cs | 44 ++ .../Vector512SByteAsGeneric_Boolean.cs | 44 ++ .../Vector512SingleAsGeneric_Boolean.cs | 44 ++ .../Vector512UInt16AsGeneric_Boolean.cs | 44 ++ .../Vector512UInt32AsGeneric_Boolean.cs | 44 ++ .../Vector512UInt64AsGeneric_Boolean.cs | 44 ++ .../General/Vector128/Dot.Single.cs | 1 - .../Vector128_1/Program.Vector128_1.cs | 3 - .../Vector256/ConvertToDouble.Int64.cs | 2 - .../Vector256/ConvertToDouble.UInt64.cs | 2 - .../General/Vector256/Dot.Single.cs | 1 - .../Vector256_1/Program.Vector256_1.cs | 3 - .../General/Vector256_1/Vector256_1_r.csproj | 4 - .../General/Vector256_1/Vector256_1_ro.csproj | 4 - .../General/Vector512/Abs.Byte.cs | 315 ++++++++++++++ .../General/Vector512/Abs.Double.cs | 315 ++++++++++++++ .../General/Vector512/Abs.Int16.cs | 315 ++++++++++++++ .../General/Vector512/Abs.Int32.cs | 315 ++++++++++++++ .../General/Vector512/Abs.Int64.cs | 315 ++++++++++++++ .../General/Vector512/Abs.SByte.cs | 315 ++++++++++++++ .../General/Vector512/Abs.Single.cs | 315 ++++++++++++++ .../General/Vector512/Abs.UInt16.cs | 315 ++++++++++++++ .../General/Vector512/Abs.UInt32.cs | 315 ++++++++++++++ .../General/Vector512/Abs.UInt64.cs | 315 ++++++++++++++ .../General/Vector512/Add.Byte.cs | 346 +++++++++++++++ .../General/Vector512/Add.Double.cs | 346 +++++++++++++++ .../General/Vector512/Add.Int16.cs | 346 +++++++++++++++ .../General/Vector512/Add.Int32.cs | 346 +++++++++++++++ .../General/Vector512/Add.Int64.cs | 346 +++++++++++++++ .../General/Vector512/Add.SByte.cs | 346 +++++++++++++++ .../General/Vector512/Add.Single.cs | 346 +++++++++++++++ .../General/Vector512/Add.UInt16.cs | 346 +++++++++++++++ .../General/Vector512/Add.UInt32.cs | 346 +++++++++++++++ .../General/Vector512/Add.UInt64.cs | 346 +++++++++++++++ .../General/Vector512/AndNot.Byte.cs | 346 +++++++++++++++ .../General/Vector512/AndNot.Double.cs | 346 +++++++++++++++ .../General/Vector512/AndNot.Int16.cs | 346 +++++++++++++++ .../General/Vector512/AndNot.Int32.cs | 346 +++++++++++++++ .../General/Vector512/AndNot.Int64.cs | 346 +++++++++++++++ .../General/Vector512/AndNot.SByte.cs | 346 +++++++++++++++ .../General/Vector512/AndNot.Single.cs | 346 +++++++++++++++ .../General/Vector512/AndNot.UInt16.cs | 346 +++++++++++++++ .../General/Vector512/AndNot.UInt32.cs | 346 +++++++++++++++ .../General/Vector512/AndNot.UInt64.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseAnd.Byte.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseAnd.Double.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseAnd.Int16.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseAnd.Int32.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseAnd.Int64.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseAnd.SByte.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseAnd.Single.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseAnd.UInt16.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseAnd.UInt32.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseAnd.UInt64.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseOr.Byte.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseOr.Double.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseOr.Int16.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseOr.Int32.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseOr.Int64.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseOr.SByte.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseOr.Single.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseOr.UInt16.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseOr.UInt32.cs | 346 +++++++++++++++ .../General/Vector512/BitwiseOr.UInt64.cs | 346 +++++++++++++++ .../General/Vector512/Ceiling.Double.cs | 315 ++++++++++++++ .../General/Vector512/Ceiling.Single.cs | 315 ++++++++++++++ .../Vector512/ConditionalSelect.Byte.cs | 377 +++++++++++++++++ .../Vector512/ConditionalSelect.Double.cs | 377 +++++++++++++++++ .../Vector512/ConditionalSelect.Int16.cs | 377 +++++++++++++++++ .../Vector512/ConditionalSelect.Int32.cs | 377 +++++++++++++++++ .../Vector512/ConditionalSelect.Int64.cs | 377 +++++++++++++++++ .../Vector512/ConditionalSelect.SByte.cs | 377 +++++++++++++++++ .../Vector512/ConditionalSelect.Single.cs | 377 +++++++++++++++++ .../Vector512/ConditionalSelect.UInt16.cs | 377 +++++++++++++++++ .../Vector512/ConditionalSelect.UInt32.cs | 377 +++++++++++++++++ .../Vector512/ConditionalSelect.UInt64.cs | 377 +++++++++++++++++ .../Vector512/ConvertToDouble.Int64.cs | 315 ++++++++++++++ .../Vector512/ConvertToDouble.UInt64.cs | 315 ++++++++++++++ .../Vector512/ConvertToInt32.Single.cs | 315 ++++++++++++++ .../Vector512/ConvertToInt64.Double.cs | 315 ++++++++++++++ .../Vector512/ConvertToSingle.Int32.cs | 315 ++++++++++++++ .../Vector512/ConvertToSingle.UInt32.cs | 315 ++++++++++++++ .../Vector512/ConvertToUInt32.Single.cs | 315 ++++++++++++++ .../Vector512/ConvertToUInt64.Double.cs | 315 ++++++++++++++ .../General/Vector512/Create.Byte.cs | 107 +++++ .../General/Vector512/Create.Double.cs | 107 +++++ .../General/Vector512/Create.Int16.cs | 107 +++++ .../General/Vector512/Create.Int32.cs | 107 +++++ .../General/Vector512/Create.Int64.cs | 107 +++++ .../General/Vector512/Create.SByte.cs | 107 +++++ .../General/Vector512/Create.Single.cs | 107 +++++ .../General/Vector512/Create.UInt16.cs | 107 +++++ .../General/Vector512/Create.UInt32.cs | 107 +++++ .../General/Vector512/Create.UInt64.cs | 107 +++++ .../General/Vector512/CreateElement.Byte.cs | 114 +++++ .../General/Vector512/CreateElement.Double.cs | 114 +++++ .../General/Vector512/CreateElement.Int16.cs | 114 +++++ .../General/Vector512/CreateElement.Int32.cs | 114 +++++ .../General/Vector512/CreateElement.Int64.cs | 114 +++++ .../General/Vector512/CreateElement.SByte.cs | 114 +++++ .../General/Vector512/CreateElement.Single.cs | 114 +++++ .../General/Vector512/CreateElement.UInt16.cs | 114 +++++ .../General/Vector512/CreateElement.UInt32.cs | 114 +++++ .../General/Vector512/CreateElement.UInt64.cs | 114 +++++ .../General/Vector512/CreateScalar.Byte.cs | 107 +++++ .../General/Vector512/CreateScalar.Double.cs | 107 +++++ .../General/Vector512/CreateScalar.Int16.cs | 107 +++++ .../General/Vector512/CreateScalar.Int32.cs | 107 +++++ .../General/Vector512/CreateScalar.Int64.cs | 107 +++++ .../General/Vector512/CreateScalar.SByte.cs | 107 +++++ .../General/Vector512/CreateScalar.Single.cs | 107 +++++ .../General/Vector512/CreateScalar.UInt16.cs | 107 +++++ .../General/Vector512/CreateScalar.UInt32.cs | 107 +++++ .../General/Vector512/CreateScalar.UInt64.cs | 107 +++++ .../Vector512/CreateScalarUnsafe.Byte.cs | 107 +++++ .../Vector512/CreateScalarUnsafe.Double.cs | 107 +++++ .../Vector512/CreateScalarUnsafe.Int16.cs | 107 +++++ .../Vector512/CreateScalarUnsafe.Int32.cs | 107 +++++ .../Vector512/CreateScalarUnsafe.Int64.cs | 107 +++++ .../Vector512/CreateScalarUnsafe.SByte.cs | 107 +++++ .../Vector512/CreateScalarUnsafe.Single.cs | 107 +++++ .../Vector512/CreateScalarUnsafe.UInt16.cs | 107 +++++ .../Vector512/CreateScalarUnsafe.UInt32.cs | 107 +++++ .../Vector512/CreateScalarUnsafe.UInt64.cs | 107 +++++ .../General/Vector512/CreateVector.Byte.cs | 120 ++++++ .../General/Vector512/CreateVector.Double.cs | 120 ++++++ .../General/Vector512/CreateVector.Int16.cs | 120 ++++++ .../General/Vector512/CreateVector.Int32.cs | 120 ++++++ .../General/Vector512/CreateVector.Int64.cs | 120 ++++++ .../General/Vector512/CreateVector.SByte.cs | 120 ++++++ .../General/Vector512/CreateVector.Single.cs | 120 ++++++ .../General/Vector512/CreateVector.UInt16.cs | 120 ++++++ .../General/Vector512/CreateVector.UInt32.cs | 120 ++++++ .../General/Vector512/CreateVector.UInt64.cs | 120 ++++++ .../General/Vector512/Divide.Byte.cs | 346 +++++++++++++++ .../General/Vector512/Divide.Double.cs | 346 +++++++++++++++ .../General/Vector512/Divide.Int16.cs | 346 +++++++++++++++ .../General/Vector512/Divide.Int32.cs | 346 +++++++++++++++ .../General/Vector512/Divide.Int64.cs | 346 +++++++++++++++ .../General/Vector512/Divide.SByte.cs | 346 +++++++++++++++ .../General/Vector512/Divide.Single.cs | 346 +++++++++++++++ .../General/Vector512/Divide.UInt16.cs | 346 +++++++++++++++ .../General/Vector512/Divide.UInt32.cs | 346 +++++++++++++++ .../General/Vector512/Divide.UInt64.cs | 346 +++++++++++++++ .../General/Vector512/Dot.Byte.cs | 328 ++++++++++++++ .../General/Vector512/Dot.Double.cs | 328 ++++++++++++++ .../General/Vector512/Dot.Int16.cs | 328 ++++++++++++++ .../General/Vector512/Dot.Int32.cs | 328 ++++++++++++++ .../General/Vector512/Dot.Int64.cs | 328 ++++++++++++++ .../General/Vector512/Dot.SByte.cs | 328 ++++++++++++++ .../General/Vector512/Dot.Single.cs | 328 ++++++++++++++ .../General/Vector512/Dot.UInt16.cs | 328 ++++++++++++++ .../General/Vector512/Dot.UInt32.cs | 328 ++++++++++++++ .../General/Vector512/Dot.UInt64.cs | 328 ++++++++++++++ .../General/Vector512/Equals.Byte.cs | 346 +++++++++++++++ .../General/Vector512/Equals.Double.cs | 346 +++++++++++++++ .../General/Vector512/Equals.Int16.cs | 346 +++++++++++++++ .../General/Vector512/Equals.Int32.cs | 346 +++++++++++++++ .../General/Vector512/Equals.Int64.cs | 346 +++++++++++++++ .../General/Vector512/Equals.SByte.cs | 346 +++++++++++++++ .../General/Vector512/Equals.Single.cs | 346 +++++++++++++++ .../General/Vector512/Equals.UInt16.cs | 346 +++++++++++++++ .../General/Vector512/Equals.UInt32.cs | 346 +++++++++++++++ .../General/Vector512/Equals.UInt64.cs | 346 +++++++++++++++ .../General/Vector512/EqualsAll.Byte.cs | 317 ++++++++++++++ .../General/Vector512/EqualsAll.Double.cs | 317 ++++++++++++++ .../General/Vector512/EqualsAll.Int16.cs | 317 ++++++++++++++ .../General/Vector512/EqualsAll.Int32.cs | 317 ++++++++++++++ .../General/Vector512/EqualsAll.Int64.cs | 317 ++++++++++++++ .../General/Vector512/EqualsAll.SByte.cs | 317 ++++++++++++++ .../General/Vector512/EqualsAll.Single.cs | 317 ++++++++++++++ .../General/Vector512/EqualsAll.UInt16.cs | 317 ++++++++++++++ .../General/Vector512/EqualsAll.UInt32.cs | 317 ++++++++++++++ .../General/Vector512/EqualsAll.UInt64.cs | 317 ++++++++++++++ .../General/Vector512/EqualsAny.Byte.cs | 317 ++++++++++++++ .../General/Vector512/EqualsAny.Double.cs | 317 ++++++++++++++ .../General/Vector512/EqualsAny.Int16.cs | 317 ++++++++++++++ .../General/Vector512/EqualsAny.Int32.cs | 317 ++++++++++++++ .../General/Vector512/EqualsAny.Int64.cs | 317 ++++++++++++++ .../General/Vector512/EqualsAny.SByte.cs | 317 ++++++++++++++ .../General/Vector512/EqualsAny.Single.cs | 317 ++++++++++++++ .../General/Vector512/EqualsAny.UInt16.cs | 317 ++++++++++++++ .../General/Vector512/EqualsAny.UInt32.cs | 317 ++++++++++++++ .../General/Vector512/EqualsAny.UInt64.cs | 317 ++++++++++++++ .../General/Vector512/Floor.Double.cs | 315 ++++++++++++++ .../General/Vector512/Floor.Single.cs | 315 ++++++++++++++ .../General/Vector512/GreaterThan.Byte.cs | 346 +++++++++++++++ .../General/Vector512/GreaterThan.Double.cs | 346 +++++++++++++++ .../General/Vector512/GreaterThan.Int16.cs | 346 +++++++++++++++ .../General/Vector512/GreaterThan.Int32.cs | 346 +++++++++++++++ .../General/Vector512/GreaterThan.Int64.cs | 346 +++++++++++++++ .../General/Vector512/GreaterThan.SByte.cs | 346 +++++++++++++++ .../General/Vector512/GreaterThan.Single.cs | 346 +++++++++++++++ .../General/Vector512/GreaterThan.UInt16.cs | 346 +++++++++++++++ .../General/Vector512/GreaterThan.UInt32.cs | 346 +++++++++++++++ .../General/Vector512/GreaterThan.UInt64.cs | 346 +++++++++++++++ .../General/Vector512/GreaterThanAll.Byte.cs | 317 ++++++++++++++ .../Vector512/GreaterThanAll.Double.cs | 317 ++++++++++++++ .../General/Vector512/GreaterThanAll.Int16.cs | 317 ++++++++++++++ .../General/Vector512/GreaterThanAll.Int32.cs | 317 ++++++++++++++ .../General/Vector512/GreaterThanAll.Int64.cs | 317 ++++++++++++++ .../General/Vector512/GreaterThanAll.SByte.cs | 317 ++++++++++++++ .../Vector512/GreaterThanAll.Single.cs | 317 ++++++++++++++ .../Vector512/GreaterThanAll.UInt16.cs | 317 ++++++++++++++ .../Vector512/GreaterThanAll.UInt32.cs | 317 ++++++++++++++ .../Vector512/GreaterThanAll.UInt64.cs | 317 ++++++++++++++ .../General/Vector512/GreaterThanAny.Byte.cs | 317 ++++++++++++++ .../Vector512/GreaterThanAny.Double.cs | 317 ++++++++++++++ .../General/Vector512/GreaterThanAny.Int16.cs | 317 ++++++++++++++ .../General/Vector512/GreaterThanAny.Int32.cs | 317 ++++++++++++++ .../General/Vector512/GreaterThanAny.Int64.cs | 317 ++++++++++++++ .../General/Vector512/GreaterThanAny.SByte.cs | 317 ++++++++++++++ .../Vector512/GreaterThanAny.Single.cs | 317 ++++++++++++++ .../Vector512/GreaterThanAny.UInt16.cs | 317 ++++++++++++++ .../Vector512/GreaterThanAny.UInt32.cs | 317 ++++++++++++++ .../Vector512/GreaterThanAny.UInt64.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqual.Byte.cs | 346 +++++++++++++++ .../Vector512/GreaterThanOrEqual.Double.cs | 346 +++++++++++++++ .../Vector512/GreaterThanOrEqual.Int16.cs | 346 +++++++++++++++ .../Vector512/GreaterThanOrEqual.Int32.cs | 346 +++++++++++++++ .../Vector512/GreaterThanOrEqual.Int64.cs | 346 +++++++++++++++ .../Vector512/GreaterThanOrEqual.SByte.cs | 346 +++++++++++++++ .../Vector512/GreaterThanOrEqual.Single.cs | 346 +++++++++++++++ .../Vector512/GreaterThanOrEqual.UInt16.cs | 346 +++++++++++++++ .../Vector512/GreaterThanOrEqual.UInt32.cs | 346 +++++++++++++++ .../Vector512/GreaterThanOrEqual.UInt64.cs | 346 +++++++++++++++ .../Vector512/GreaterThanOrEqualAll.Byte.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqualAll.Double.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqualAll.Int16.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqualAll.Int32.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqualAll.Int64.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqualAll.SByte.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqualAll.Single.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqualAll.UInt16.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqualAll.UInt32.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqualAll.UInt64.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqualAny.Byte.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqualAny.Double.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqualAny.Int16.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqualAny.Int32.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqualAny.Int64.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqualAny.SByte.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqualAny.Single.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqualAny.UInt16.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqualAny.UInt32.cs | 317 ++++++++++++++ .../Vector512/GreaterThanOrEqualAny.UInt64.cs | 317 ++++++++++++++ .../General/Vector512/LessThan.Byte.cs | 346 +++++++++++++++ .../General/Vector512/LessThan.Double.cs | 346 +++++++++++++++ .../General/Vector512/LessThan.Int16.cs | 346 +++++++++++++++ .../General/Vector512/LessThan.Int32.cs | 346 +++++++++++++++ .../General/Vector512/LessThan.Int64.cs | 346 +++++++++++++++ .../General/Vector512/LessThan.SByte.cs | 346 +++++++++++++++ .../General/Vector512/LessThan.Single.cs | 346 +++++++++++++++ .../General/Vector512/LessThan.UInt16.cs | 346 +++++++++++++++ .../General/Vector512/LessThan.UInt32.cs | 346 +++++++++++++++ .../General/Vector512/LessThan.UInt64.cs | 346 +++++++++++++++ .../General/Vector512/LessThanAll.Byte.cs | 317 ++++++++++++++ .../General/Vector512/LessThanAll.Double.cs | 317 ++++++++++++++ .../General/Vector512/LessThanAll.Int16.cs | 317 ++++++++++++++ .../General/Vector512/LessThanAll.Int32.cs | 317 ++++++++++++++ .../General/Vector512/LessThanAll.Int64.cs | 317 ++++++++++++++ .../General/Vector512/LessThanAll.SByte.cs | 317 ++++++++++++++ .../General/Vector512/LessThanAll.Single.cs | 317 ++++++++++++++ .../General/Vector512/LessThanAll.UInt16.cs | 317 ++++++++++++++ .../General/Vector512/LessThanAll.UInt32.cs | 317 ++++++++++++++ .../General/Vector512/LessThanAll.UInt64.cs | 317 ++++++++++++++ .../General/Vector512/LessThanAny.Byte.cs | 317 ++++++++++++++ .../General/Vector512/LessThanAny.Double.cs | 317 ++++++++++++++ .../General/Vector512/LessThanAny.Int16.cs | 317 ++++++++++++++ .../General/Vector512/LessThanAny.Int32.cs | 317 ++++++++++++++ .../General/Vector512/LessThanAny.Int64.cs | 317 ++++++++++++++ .../General/Vector512/LessThanAny.SByte.cs | 317 ++++++++++++++ .../General/Vector512/LessThanAny.Single.cs | 317 ++++++++++++++ .../General/Vector512/LessThanAny.UInt16.cs | 317 ++++++++++++++ .../General/Vector512/LessThanAny.UInt32.cs | 317 ++++++++++++++ .../General/Vector512/LessThanAny.UInt64.cs | 317 ++++++++++++++ .../General/Vector512/LessThanOrEqual.Byte.cs | 346 +++++++++++++++ .../Vector512/LessThanOrEqual.Double.cs | 346 +++++++++++++++ .../Vector512/LessThanOrEqual.Int16.cs | 346 +++++++++++++++ .../Vector512/LessThanOrEqual.Int32.cs | 346 +++++++++++++++ .../Vector512/LessThanOrEqual.Int64.cs | 346 +++++++++++++++ .../Vector512/LessThanOrEqual.SByte.cs | 346 +++++++++++++++ .../Vector512/LessThanOrEqual.Single.cs | 346 +++++++++++++++ .../Vector512/LessThanOrEqual.UInt16.cs | 346 +++++++++++++++ .../Vector512/LessThanOrEqual.UInt32.cs | 346 +++++++++++++++ .../Vector512/LessThanOrEqual.UInt64.cs | 346 +++++++++++++++ .../Vector512/LessThanOrEqualAll.Byte.cs | 317 ++++++++++++++ .../Vector512/LessThanOrEqualAll.Double.cs | 317 ++++++++++++++ .../Vector512/LessThanOrEqualAll.Int16.cs | 317 ++++++++++++++ .../Vector512/LessThanOrEqualAll.Int32.cs | 317 ++++++++++++++ .../Vector512/LessThanOrEqualAll.Int64.cs | 317 ++++++++++++++ .../Vector512/LessThanOrEqualAll.SByte.cs | 317 ++++++++++++++ .../Vector512/LessThanOrEqualAll.Single.cs | 317 ++++++++++++++ .../Vector512/LessThanOrEqualAll.UInt16.cs | 317 ++++++++++++++ .../Vector512/LessThanOrEqualAll.UInt32.cs | 317 ++++++++++++++ .../Vector512/LessThanOrEqualAll.UInt64.cs | 317 ++++++++++++++ .../Vector512/LessThanOrEqualAny.Byte.cs | 317 ++++++++++++++ .../Vector512/LessThanOrEqualAny.Double.cs | 317 ++++++++++++++ .../Vector512/LessThanOrEqualAny.Int16.cs | 317 ++++++++++++++ .../Vector512/LessThanOrEqualAny.Int32.cs | 317 ++++++++++++++ .../Vector512/LessThanOrEqualAny.Int64.cs | 317 ++++++++++++++ .../Vector512/LessThanOrEqualAny.SByte.cs | 317 ++++++++++++++ .../Vector512/LessThanOrEqualAny.Single.cs | 317 ++++++++++++++ .../Vector512/LessThanOrEqualAny.UInt16.cs | 317 ++++++++++++++ .../Vector512/LessThanOrEqualAny.UInt32.cs | 317 ++++++++++++++ .../Vector512/LessThanOrEqualAny.UInt64.cs | 317 ++++++++++++++ .../General/Vector512/Max.Byte.cs | 346 +++++++++++++++ .../General/Vector512/Max.Double.cs | 346 +++++++++++++++ .../General/Vector512/Max.Int16.cs | 346 +++++++++++++++ .../General/Vector512/Max.Int32.cs | 346 +++++++++++++++ .../General/Vector512/Max.Int64.cs | 346 +++++++++++++++ .../General/Vector512/Max.SByte.cs | 346 +++++++++++++++ .../General/Vector512/Max.Single.cs | 346 +++++++++++++++ .../General/Vector512/Max.UInt16.cs | 346 +++++++++++++++ .../General/Vector512/Max.UInt32.cs | 346 +++++++++++++++ .../General/Vector512/Max.UInt64.cs | 346 +++++++++++++++ .../General/Vector512/Min.Byte.cs | 346 +++++++++++++++ .../General/Vector512/Min.Double.cs | 346 +++++++++++++++ .../General/Vector512/Min.Int16.cs | 346 +++++++++++++++ .../General/Vector512/Min.Int32.cs | 346 +++++++++++++++ .../General/Vector512/Min.Int64.cs | 346 +++++++++++++++ .../General/Vector512/Min.SByte.cs | 346 +++++++++++++++ .../General/Vector512/Min.Single.cs | 346 +++++++++++++++ .../General/Vector512/Min.UInt16.cs | 346 +++++++++++++++ .../General/Vector512/Min.UInt32.cs | 346 +++++++++++++++ .../General/Vector512/Min.UInt64.cs | 346 +++++++++++++++ .../General/Vector512/Multiply.Byte.cs | 346 +++++++++++++++ .../General/Vector512/Multiply.Double.cs | 346 +++++++++++++++ .../General/Vector512/Multiply.Int16.cs | 346 +++++++++++++++ .../General/Vector512/Multiply.Int32.cs | 346 +++++++++++++++ .../General/Vector512/Multiply.Int64.cs | 346 +++++++++++++++ .../General/Vector512/Multiply.SByte.cs | 346 +++++++++++++++ .../General/Vector512/Multiply.Single.cs | 346 +++++++++++++++ .../General/Vector512/Multiply.UInt16.cs | 346 +++++++++++++++ .../General/Vector512/Multiply.UInt32.cs | 346 +++++++++++++++ .../General/Vector512/Multiply.UInt64.cs | 346 +++++++++++++++ .../General/Vector512/Narrow.Double.cs | 346 +++++++++++++++ .../General/Vector512/Narrow.Int16.cs | 346 +++++++++++++++ .../General/Vector512/Narrow.Int32.cs | 346 +++++++++++++++ .../General/Vector512/Narrow.Int64.cs | 346 +++++++++++++++ .../General/Vector512/Narrow.UInt16.cs | 346 +++++++++++++++ .../General/Vector512/Narrow.UInt32.cs | 346 +++++++++++++++ .../General/Vector512/Narrow.UInt64.cs | 346 +++++++++++++++ .../General/Vector512/Negate.Byte.cs | 315 ++++++++++++++ .../General/Vector512/Negate.Double.cs | 315 ++++++++++++++ .../General/Vector512/Negate.Int16.cs | 315 ++++++++++++++ .../General/Vector512/Negate.Int32.cs | 315 ++++++++++++++ .../General/Vector512/Negate.Int64.cs | 315 ++++++++++++++ .../General/Vector512/Negate.SByte.cs | 315 ++++++++++++++ .../General/Vector512/Negate.Single.cs | 315 ++++++++++++++ .../General/Vector512/Negate.UInt16.cs | 315 ++++++++++++++ .../General/Vector512/Negate.UInt32.cs | 315 ++++++++++++++ .../General/Vector512/Negate.UInt64.cs | 315 ++++++++++++++ .../General/Vector512/OnesComplement.Byte.cs | 315 ++++++++++++++ .../Vector512/OnesComplement.Double.cs | 315 ++++++++++++++ .../General/Vector512/OnesComplement.Int16.cs | 315 ++++++++++++++ .../General/Vector512/OnesComplement.Int32.cs | 315 ++++++++++++++ .../General/Vector512/OnesComplement.Int64.cs | 315 ++++++++++++++ .../General/Vector512/OnesComplement.SByte.cs | 315 ++++++++++++++ .../Vector512/OnesComplement.Single.cs | 315 ++++++++++++++ .../Vector512/OnesComplement.UInt16.cs | 315 ++++++++++++++ .../Vector512/OnesComplement.UInt32.cs | 315 ++++++++++++++ .../Vector512/OnesComplement.UInt64.cs | 315 ++++++++++++++ .../General/Vector512/Program.Vector512.cs | 16 + .../General/Vector512/Sqrt.Byte.cs | 315 ++++++++++++++ .../General/Vector512/Sqrt.Double.cs | 315 ++++++++++++++ .../General/Vector512/Sqrt.Int16.cs | 315 ++++++++++++++ .../General/Vector512/Sqrt.Int32.cs | 315 ++++++++++++++ .../General/Vector512/Sqrt.Int64.cs | 315 ++++++++++++++ .../General/Vector512/Sqrt.SByte.cs | 315 ++++++++++++++ .../General/Vector512/Sqrt.Single.cs | 315 ++++++++++++++ .../General/Vector512/Sqrt.UInt16.cs | 315 ++++++++++++++ .../General/Vector512/Sqrt.UInt32.cs | 315 ++++++++++++++ .../General/Vector512/Sqrt.UInt64.cs | 315 ++++++++++++++ .../General/Vector512/Subtract.Byte.cs | 346 +++++++++++++++ .../General/Vector512/Subtract.Double.cs | 346 +++++++++++++++ .../General/Vector512/Subtract.Int16.cs | 346 +++++++++++++++ .../General/Vector512/Subtract.Int32.cs | 346 +++++++++++++++ .../General/Vector512/Subtract.Int64.cs | 346 +++++++++++++++ .../General/Vector512/Subtract.SByte.cs | 346 +++++++++++++++ .../General/Vector512/Subtract.Single.cs | 346 +++++++++++++++ .../General/Vector512/Subtract.UInt16.cs | 346 +++++++++++++++ .../General/Vector512/Subtract.UInt32.cs | 346 +++++++++++++++ .../General/Vector512/Subtract.UInt64.cs | 346 +++++++++++++++ .../General/Vector512/Vector512_r.csproj | 400 ++++++++++++++++++ .../General/Vector512/Vector512_ro.csproj | 400 ++++++++++++++++++ .../General/Vector512/Widen.Double.cs | 337 +++++++++++++++ .../General/Vector512/Widen.Int16.cs | 337 +++++++++++++++ .../General/Vector512/Widen.Int32.cs | 337 +++++++++++++++ .../General/Vector512/Widen.Int64.cs | 337 +++++++++++++++ .../General/Vector512/Widen.UInt16.cs | 337 +++++++++++++++ .../General/Vector512/Widen.UInt32.cs | 337 +++++++++++++++ .../General/Vector512/Widen.UInt64.cs | 337 +++++++++++++++ .../General/Vector512/Xor.Byte.cs | 346 +++++++++++++++ .../General/Vector512/Xor.Double.cs | 346 +++++++++++++++ .../General/Vector512/Xor.Int16.cs | 346 +++++++++++++++ .../General/Vector512/Xor.Int32.cs | 346 +++++++++++++++ .../General/Vector512/Xor.Int64.cs | 346 +++++++++++++++ .../General/Vector512/Xor.SByte.cs | 346 +++++++++++++++ .../General/Vector512/Xor.Single.cs | 346 +++++++++++++++ .../General/Vector512/Xor.UInt16.cs | 346 +++++++++++++++ .../General/Vector512/Xor.UInt32.cs | 346 +++++++++++++++ .../General/Vector512/Xor.UInt64.cs | 346 +++++++++++++++ .../General/Vector512_1/AllBitsSet.Byte.cs | 107 +++++ .../General/Vector512_1/AllBitsSet.Double.cs | 107 +++++ .../General/Vector512_1/AllBitsSet.Int16.cs | 107 +++++ .../General/Vector512_1/AllBitsSet.Int32.cs | 107 +++++ .../General/Vector512_1/AllBitsSet.Int64.cs | 107 +++++ .../General/Vector512_1/AllBitsSet.SByte.cs | 107 +++++ .../General/Vector512_1/AllBitsSet.Single.cs | 107 +++++ .../General/Vector512_1/AllBitsSet.UInt16.cs | 107 +++++ .../General/Vector512_1/AllBitsSet.UInt32.cs | 107 +++++ .../General/Vector512_1/AllBitsSet.UInt64.cs | 107 +++++ .../General/Vector512_1/As.Byte.cs | 254 +++++++++++ .../General/Vector512_1/As.Double.cs | 254 +++++++++++ .../General/Vector512_1/As.Int16.cs | 254 +++++++++++ .../General/Vector512_1/As.Int32.cs | 254 +++++++++++ .../General/Vector512_1/As.Int64.cs | 254 +++++++++++ .../General/Vector512_1/As.SByte.cs | 254 +++++++++++ .../General/Vector512_1/As.Single.cs | 254 +++++++++++ .../General/Vector512_1/As.UInt16.cs | 254 +++++++++++ .../General/Vector512_1/As.UInt32.cs | 254 +++++++++++ .../General/Vector512_1/As.UInt64.cs | 254 +++++++++++ .../General/Vector512_1/AsVector.Byte.cs | 163 +++++++ .../General/Vector512_1/AsVector.Double.cs | 163 +++++++ .../General/Vector512_1/AsVector.Int16.cs | 163 +++++++ .../General/Vector512_1/AsVector.Int32.cs | 163 +++++++ .../General/Vector512_1/AsVector.Int64.cs | 163 +++++++ .../General/Vector512_1/AsVector.SByte.cs | 163 +++++++ .../General/Vector512_1/AsVector.Single.cs | 163 +++++++ .../General/Vector512_1/AsVector.UInt16.cs | 163 +++++++ .../General/Vector512_1/AsVector.UInt32.cs | 163 +++++++ .../General/Vector512_1/AsVector.UInt64.cs | 163 +++++++ .../Vector512_1/GetAndWithElement.Byte.0.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Byte.15.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Byte.31.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Byte.7.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Double.0.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Double.1.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Double.3.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Int16.0.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Int16.15.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Int16.3.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Int16.7.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Int32.0.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Int32.1.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Int32.3.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Int32.7.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Int64.0.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Int64.1.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Int64.3.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.SByte.0.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.SByte.15.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.SByte.31.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.SByte.7.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Single.0.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Single.1.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Single.3.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.Single.7.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.UInt16.0.cs | 230 ++++++++++ .../GetAndWithElement.UInt16.15.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.UInt16.3.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.UInt16.7.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.UInt32.0.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.UInt32.1.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.UInt32.3.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.UInt32.7.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.UInt64.0.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.UInt64.1.cs | 230 ++++++++++ .../Vector512_1/GetAndWithElement.UInt64.3.cs | 230 ++++++++++ .../GetAndWithLowerAndUpper.Byte.cs | 211 +++++++++ .../GetAndWithLowerAndUpper.Double.cs | 211 +++++++++ .../GetAndWithLowerAndUpper.Int16.cs | 211 +++++++++ .../GetAndWithLowerAndUpper.Int32.cs | 211 +++++++++ .../GetAndWithLowerAndUpper.Int64.cs | 211 +++++++++ .../GetAndWithLowerAndUpper.SByte.cs | 211 +++++++++ .../GetAndWithLowerAndUpper.Single.cs | 211 +++++++++ .../GetAndWithLowerAndUpper.UInt16.cs | 211 +++++++++ .../GetAndWithLowerAndUpper.UInt32.cs | 211 +++++++++ .../GetAndWithLowerAndUpper.UInt64.cs | 211 +++++++++ .../Vector512_1/Program.Vector512_1.cs | 16 + .../General/Vector512_1/ToScalar.Byte.cs | 98 +++++ .../General/Vector512_1/ToScalar.Double.cs | 98 +++++ .../General/Vector512_1/ToScalar.Int16.cs | 98 +++++ .../General/Vector512_1/ToScalar.Int32.cs | 98 +++++ .../General/Vector512_1/ToScalar.Int64.cs | 98 +++++ .../General/Vector512_1/ToScalar.SByte.cs | 98 +++++ .../General/Vector512_1/ToScalar.Single.cs | 98 +++++ .../General/Vector512_1/ToScalar.UInt16.cs | 98 +++++ .../General/Vector512_1/ToScalar.UInt32.cs | 98 +++++ .../General/Vector512_1/ToScalar.UInt64.cs | 98 +++++ .../General/Vector512_1/ToString.Byte.cs | 51 +++ .../General/Vector512_1/ToString.Double.cs | 51 +++ .../General/Vector512_1/ToString.Int16.cs | 51 +++ .../General/Vector512_1/ToString.Int32.cs | 51 +++ .../General/Vector512_1/ToString.Int64.cs | 51 +++ .../General/Vector512_1/ToString.SByte.cs | 51 +++ .../General/Vector512_1/ToString.Single.cs | 51 +++ .../General/Vector512_1/ToString.UInt16.cs | 51 +++ .../General/Vector512_1/ToString.UInt32.cs | 51 +++ .../General/Vector512_1/ToString.UInt64.cs | 51 +++ .../General/Vector512_1/Vector512_1_r.csproj | 241 +++++++++++ .../General/Vector512_1/Vector512_1_ro.csproj | 241 +++++++++++ .../General/Vector512_1/Zero.Byte.cs | 98 +++++ .../General/Vector512_1/Zero.Double.cs | 98 +++++ .../General/Vector512_1/Zero.Int16.cs | 98 +++++ .../General/Vector512_1/Zero.Int32.cs | 98 +++++ .../General/Vector512_1/Zero.Int64.cs | 98 +++++ .../General/Vector512_1/Zero.SByte.cs | 98 +++++ .../General/Vector512_1/Zero.Single.cs | 98 +++++ .../General/Vector512_1/Zero.UInt16.cs | 98 +++++ .../General/Vector512_1/Zero.UInt32.cs | 98 +++++ .../General/Vector512_1/Zero.UInt64.cs | 98 +++++ .../General/Vector512_1/op_Addition.Byte.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Addition.Double.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Addition.Int16.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Addition.Int32.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Addition.Int64.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Addition.SByte.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Addition.Single.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Addition.UInt16.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Addition.UInt32.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Addition.UInt64.cs | 323 ++++++++++++++ .../General/Vector512_1/op_BitwiseAnd.Byte.cs | 323 ++++++++++++++ .../Vector512_1/op_BitwiseAnd.Double.cs | 323 ++++++++++++++ .../Vector512_1/op_BitwiseAnd.Int16.cs | 323 ++++++++++++++ .../Vector512_1/op_BitwiseAnd.Int32.cs | 323 ++++++++++++++ .../Vector512_1/op_BitwiseAnd.Int64.cs | 323 ++++++++++++++ .../Vector512_1/op_BitwiseAnd.SByte.cs | 323 ++++++++++++++ .../Vector512_1/op_BitwiseAnd.Single.cs | 323 ++++++++++++++ .../Vector512_1/op_BitwiseAnd.UInt16.cs | 323 ++++++++++++++ .../Vector512_1/op_BitwiseAnd.UInt32.cs | 323 ++++++++++++++ .../Vector512_1/op_BitwiseAnd.UInt64.cs | 323 ++++++++++++++ .../General/Vector512_1/op_BitwiseOr.Byte.cs | 323 ++++++++++++++ .../Vector512_1/op_BitwiseOr.Double.cs | 323 ++++++++++++++ .../General/Vector512_1/op_BitwiseOr.Int16.cs | 323 ++++++++++++++ .../General/Vector512_1/op_BitwiseOr.Int32.cs | 323 ++++++++++++++ .../General/Vector512_1/op_BitwiseOr.Int64.cs | 323 ++++++++++++++ .../General/Vector512_1/op_BitwiseOr.SByte.cs | 323 ++++++++++++++ .../Vector512_1/op_BitwiseOr.Single.cs | 323 ++++++++++++++ .../Vector512_1/op_BitwiseOr.UInt16.cs | 323 ++++++++++++++ .../Vector512_1/op_BitwiseOr.UInt32.cs | 323 ++++++++++++++ .../Vector512_1/op_BitwiseOr.UInt64.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Division.Byte.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Division.Double.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Division.Int16.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Division.Int32.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Division.Int64.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Division.SByte.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Division.Single.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Division.UInt16.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Division.UInt32.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Division.UInt64.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Equality.Byte.cs | 293 +++++++++++++ .../General/Vector512_1/op_Equality.Double.cs | 293 +++++++++++++ .../General/Vector512_1/op_Equality.Int16.cs | 293 +++++++++++++ .../General/Vector512_1/op_Equality.Int32.cs | 293 +++++++++++++ .../General/Vector512_1/op_Equality.Int64.cs | 293 +++++++++++++ .../General/Vector512_1/op_Equality.SByte.cs | 293 +++++++++++++ .../General/Vector512_1/op_Equality.Single.cs | 293 +++++++++++++ .../General/Vector512_1/op_Equality.UInt16.cs | 293 +++++++++++++ .../General/Vector512_1/op_Equality.UInt32.cs | 293 +++++++++++++ .../General/Vector512_1/op_Equality.UInt64.cs | 293 +++++++++++++ .../Vector512_1/op_ExclusiveOr.Byte.cs | 323 ++++++++++++++ .../Vector512_1/op_ExclusiveOr.Double.cs | 323 ++++++++++++++ .../Vector512_1/op_ExclusiveOr.Int16.cs | 323 ++++++++++++++ .../Vector512_1/op_ExclusiveOr.Int32.cs | 323 ++++++++++++++ .../Vector512_1/op_ExclusiveOr.Int64.cs | 323 ++++++++++++++ .../Vector512_1/op_ExclusiveOr.SByte.cs | 323 ++++++++++++++ .../Vector512_1/op_ExclusiveOr.Single.cs | 323 ++++++++++++++ .../Vector512_1/op_ExclusiveOr.UInt16.cs | 323 ++++++++++++++ .../Vector512_1/op_ExclusiveOr.UInt32.cs | 323 ++++++++++++++ .../Vector512_1/op_ExclusiveOr.UInt64.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Inequality.Byte.cs | 293 +++++++++++++ .../Vector512_1/op_Inequality.Double.cs | 293 +++++++++++++ .../Vector512_1/op_Inequality.Int16.cs | 293 +++++++++++++ .../Vector512_1/op_Inequality.Int32.cs | 293 +++++++++++++ .../Vector512_1/op_Inequality.Int64.cs | 293 +++++++++++++ .../Vector512_1/op_Inequality.SByte.cs | 293 +++++++++++++ .../Vector512_1/op_Inequality.Single.cs | 293 +++++++++++++ .../Vector512_1/op_Inequality.UInt16.cs | 293 +++++++++++++ .../Vector512_1/op_Inequality.UInt32.cs | 293 +++++++++++++ .../Vector512_1/op_Inequality.UInt64.cs | 293 +++++++++++++ .../General/Vector512_1/op_Multiply.Byte.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Multiply.Double.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Multiply.Int16.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Multiply.Int32.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Multiply.Int64.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Multiply.SByte.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Multiply.Single.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Multiply.UInt16.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Multiply.UInt32.cs | 323 ++++++++++++++ .../General/Vector512_1/op_Multiply.UInt64.cs | 323 ++++++++++++++ .../Vector512_1/op_OnesComplement.Byte.cs | 296 +++++++++++++ .../Vector512_1/op_OnesComplement.Double.cs | 296 +++++++++++++ .../Vector512_1/op_OnesComplement.Int16.cs | 296 +++++++++++++ .../Vector512_1/op_OnesComplement.Int32.cs | 296 +++++++++++++ .../Vector512_1/op_OnesComplement.Int64.cs | 296 +++++++++++++ .../Vector512_1/op_OnesComplement.SByte.cs | 296 +++++++++++++ .../Vector512_1/op_OnesComplement.Single.cs | 296 +++++++++++++ .../Vector512_1/op_OnesComplement.UInt16.cs | 296 +++++++++++++ .../Vector512_1/op_OnesComplement.UInt32.cs | 296 +++++++++++++ .../Vector512_1/op_OnesComplement.UInt64.cs | 296 +++++++++++++ .../Vector512_1/op_Subtraction.Byte.cs | 323 ++++++++++++++ .../Vector512_1/op_Subtraction.Double.cs | 323 ++++++++++++++ .../Vector512_1/op_Subtraction.Int16.cs | 323 ++++++++++++++ .../Vector512_1/op_Subtraction.Int32.cs | 323 ++++++++++++++ .../Vector512_1/op_Subtraction.Int64.cs | 323 ++++++++++++++ .../Vector512_1/op_Subtraction.SByte.cs | 323 ++++++++++++++ .../Vector512_1/op_Subtraction.Single.cs | 323 ++++++++++++++ .../Vector512_1/op_Subtraction.UInt16.cs | 323 ++++++++++++++ .../Vector512_1/op_Subtraction.UInt32.cs | 323 ++++++++++++++ .../Vector512_1/op_Subtraction.UInt64.cs | 323 ++++++++++++++ .../Vector512_1/op_UnaryNegation.Byte.cs | 296 +++++++++++++ .../Vector512_1/op_UnaryNegation.Double.cs | 296 +++++++++++++ .../Vector512_1/op_UnaryNegation.Int16.cs | 296 +++++++++++++ .../Vector512_1/op_UnaryNegation.Int32.cs | 296 +++++++++++++ .../Vector512_1/op_UnaryNegation.Int64.cs | 296 +++++++++++++ .../Vector512_1/op_UnaryNegation.SByte.cs | 296 +++++++++++++ .../Vector512_1/op_UnaryNegation.Single.cs | 296 +++++++++++++ .../Vector512_1/op_UnaryNegation.UInt16.cs | 296 +++++++++++++ .../Vector512_1/op_UnaryNegation.UInt32.cs | 296 +++++++++++++ .../Vector512_1/op_UnaryNegation.UInt64.cs | 296 +++++++++++++ .../General/Vector512_1/op_UnaryPlus.Byte.cs | 296 +++++++++++++ .../Vector512_1/op_UnaryPlus.Double.cs | 296 +++++++++++++ .../General/Vector512_1/op_UnaryPlus.Int16.cs | 296 +++++++++++++ .../General/Vector512_1/op_UnaryPlus.Int32.cs | 296 +++++++++++++ .../General/Vector512_1/op_UnaryPlus.Int64.cs | 296 +++++++++++++ .../General/Vector512_1/op_UnaryPlus.SByte.cs | 296 +++++++++++++ .../Vector512_1/op_UnaryPlus.Single.cs | 296 +++++++++++++ .../Vector512_1/op_UnaryPlus.UInt16.cs | 296 +++++++++++++ .../Vector512_1/op_UnaryPlus.UInt32.cs | 296 +++++++++++++ .../Vector512_1/op_UnaryPlus.UInt64.cs | 296 +++++++++++++ 674 files changed, 176425 insertions(+), 20 deletions(-) create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAllBitsSet.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsDouble.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Boolean.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsSByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsSingle.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsUInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsUInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsUInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetElement0.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetElementMaxValue.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetElementNegativeOne.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetLower.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetUpper.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanToScalar.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanToString.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithElement0.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithElementMaxValue.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithElementNegativeOne.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithLower.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithUpper.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanZero.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512ByteAsGeneric_Boolean.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512DoubleAsGeneric_Boolean.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512Int16AsGeneric_Boolean.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512Int32AsGeneric_Boolean.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512Int64AsGeneric_Boolean.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512SByteAsGeneric_Boolean.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512SingleAsGeneric_Boolean.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512UInt16AsGeneric_Boolean.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512UInt32AsGeneric_Boolean.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512UInt64AsGeneric_Boolean.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt32.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt64.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt32.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt64.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Program.Vector512.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Vector512_r.csproj create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Vector512_ro.csproj create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.0.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.15.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.31.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.7.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Double.0.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Double.1.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Double.3.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.0.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.15.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.3.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.7.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.0.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.1.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.3.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.7.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int64.0.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int64.1.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int64.3.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.0.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.15.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.31.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.7.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.0.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.1.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.3.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.7.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.0.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.15.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.3.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.7.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.0.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.1.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.3.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.7.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt64.0.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt64.1.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt64.3.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Program.Vector512_1.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Vector512_1_r.csproj create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Vector512_1_ro.csproj create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Byte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Double.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int64.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.SByte.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Single.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt16.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt32.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt64.cs diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/NotSupported_r.csproj b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/NotSupported_r.csproj index 70aa078549abf9..cc51ab9a4159a3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/NotSupported_r.csproj +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/NotSupported_r.csproj @@ -143,6 +143,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/NotSupported_ro.csproj b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/NotSupported_ro.csproj index 23821a3e11b604..b571986dd46ae0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/NotSupported_ro.csproj +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/NotSupported_ro.csproj @@ -143,6 +143,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAllBitsSet.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAllBitsSet.cs new file mode 100644 index 00000000000000..6ca11b10bccd52 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAllBitsSet.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAllBitsSet() + { + bool succeeded = false; + + try + { + Vector512 result = Vector512.AllBitsSet; + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAllBitsSet: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsByte.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsByte.cs new file mode 100644 index 00000000000000..ca998108fca943 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsByte.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsByte() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).AsByte(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsByte: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsDouble.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsDouble.cs new file mode 100644 index 00000000000000..a5c3e4c1a90b88 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsDouble.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsDouble() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).AsDouble(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsDouble: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Boolean.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Boolean.cs new file mode 100644 index 00000000000000..b41896e9ddabc2 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Boolean.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsGeneric_Boolean() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsGeneric_Boolean: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Byte.cs new file mode 100644 index 00000000000000..f58c17a7b9ddae --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Byte.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsGeneric_Byte() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsGeneric_Byte: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Double.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Double.cs new file mode 100644 index 00000000000000..3ea7e334ff2e0e --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Double.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsGeneric_Double() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsGeneric_Double: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Int16.cs new file mode 100644 index 00000000000000..76a624ed0e0d5f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Int16.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsGeneric_Int16() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsGeneric_Int16: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Int32.cs new file mode 100644 index 00000000000000..da083c22e4b450 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Int32.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsGeneric_Int32() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsGeneric_Int32: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Int64.cs new file mode 100644 index 00000000000000..5578d856b93bb6 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Int64.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsGeneric_Int64() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsGeneric_Int64: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_SByte.cs new file mode 100644 index 00000000000000..bbed4a021943a8 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_SByte.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsGeneric_SByte() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsGeneric_SByte: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Single.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Single.cs new file mode 100644 index 00000000000000..5ee6535fddfc49 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_Single.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsGeneric_Single() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsGeneric_Single: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_UInt16.cs new file mode 100644 index 00000000000000..02561be1b2f9b5 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_UInt16.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsGeneric_UInt16() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsGeneric_UInt16: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_UInt32.cs new file mode 100644 index 00000000000000..3636ddf0a5b89a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_UInt32.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsGeneric_UInt32() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsGeneric_UInt32: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_UInt64.cs new file mode 100644 index 00000000000000..757ac8c26dbaa3 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsGeneric_UInt64.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsGeneric_UInt64() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsGeneric_UInt64: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsInt16.cs new file mode 100644 index 00000000000000..310dc020ff1aa0 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsInt16.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsInt16() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).AsInt16(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsInt16: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsInt32.cs new file mode 100644 index 00000000000000..95ce3d02e14093 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsInt32.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsInt32() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).AsInt32(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsInt32: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsInt64.cs new file mode 100644 index 00000000000000..880ef553948603 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsInt64.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsInt64() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).AsInt64(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsInt64: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsSByte.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsSByte.cs new file mode 100644 index 00000000000000..2dca3c193c8eb4 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsSByte.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsSByte() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).AsSByte(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsSByte: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsSingle.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsSingle.cs new file mode 100644 index 00000000000000..803568e690bccf --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsSingle.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsSingle() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).AsSingle(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsSingle: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsUInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsUInt16.cs new file mode 100644 index 00000000000000..f70585f487025d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsUInt16.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsUInt16() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).AsUInt16(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsUInt16: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsUInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsUInt32.cs new file mode 100644 index 00000000000000..3ec155a060565b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsUInt32.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsUInt32() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).AsUInt32(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsUInt32: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsUInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsUInt64.cs new file mode 100644 index 00000000000000..4a5153db2442ce --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanAsUInt64.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanAsUInt64() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).AsUInt64(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanAsUInt64: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetElement0.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetElement0.cs new file mode 100644 index 00000000000000..66ef1df4850b6b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetElement0.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanGetElement0() + { + bool succeeded = false; + + try + { + bool result = default(Vector512).GetElement(0); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanGetElement0: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetElementMaxValue.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetElementMaxValue.cs new file mode 100644 index 00000000000000..a290728ea1cd69 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetElementMaxValue.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanGetElementMaxValue() + { + bool succeeded = false; + + try + { + bool result = default(Vector512).GetElement(int.MaxValue); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanGetElementMaxValue: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetElementNegativeOne.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetElementNegativeOne.cs new file mode 100644 index 00000000000000..93b4b329552c7a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetElementNegativeOne.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanGetElementNegativeOne() + { + bool succeeded = false; + + try + { + bool result = default(Vector512).GetElement(-1); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanGetElementNegativeOne: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetLower.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetLower.cs new file mode 100644 index 00000000000000..8511a5501d50d4 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetLower.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanGetLower() + { + bool succeeded = false; + + try + { + Vector256 result = default(Vector512).GetLower(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanGetLower: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetUpper.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetUpper.cs new file mode 100644 index 00000000000000..a9bd1287bbc8aa --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanGetUpper.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanGetUpper() + { + bool succeeded = false; + + try + { + Vector256 result = default(Vector512).GetUpper(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanGetUpper: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanToScalar.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanToScalar.cs new file mode 100644 index 00000000000000..9444aa5c2204c7 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanToScalar.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanToScalar() + { + bool succeeded = false; + + try + { + bool result = default(Vector512).ToScalar(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanToScalar: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanToString.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanToString.cs new file mode 100644 index 00000000000000..27d04bd72051d8 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanToString.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanToString() + { + bool succeeded = false; + + try + { + string result = default(Vector512).ToString(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanToString: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithElement0.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithElement0.cs new file mode 100644 index 00000000000000..dea2fe539fefac --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithElement0.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanWithElement0() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).WithElement(0, false); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanWithElement0: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithElementMaxValue.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithElementMaxValue.cs new file mode 100644 index 00000000000000..979116284c394b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithElementMaxValue.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanWithElementMaxValue() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).WithElement(int.MaxValue, false); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanWithElementMaxValue: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithElementNegativeOne.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithElementNegativeOne.cs new file mode 100644 index 00000000000000..fc337b52e85aaa --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithElementNegativeOne.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanWithElementNegativeOne() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).WithElement(-1, false); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanWithElementNegativeOne: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithLower.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithLower.cs new file mode 100644 index 00000000000000..ca0ab7bd7b621b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithLower.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanWithLower() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).WithLower(default(Vector256)); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanWithLower: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithUpper.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithUpper.cs new file mode 100644 index 00000000000000..ba1cf037379b61 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanWithUpper.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanWithUpper() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).WithUpper(default(Vector256)); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanWithUpper: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanZero.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanZero.cs new file mode 100644 index 00000000000000..cf0c4d5938d08c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512BooleanZero.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512BooleanZero() + { + bool succeeded = false; + + try + { + Vector512 result = Vector512.Zero; + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512BooleanZero: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512ByteAsGeneric_Boolean.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512ByteAsGeneric_Boolean.cs new file mode 100644 index 00000000000000..fdb5018e17182a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512ByteAsGeneric_Boolean.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512ByteAsGeneric_Boolean() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512ByteAsGeneric_Boolean: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512DoubleAsGeneric_Boolean.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512DoubleAsGeneric_Boolean.cs new file mode 100644 index 00000000000000..7fc025691fc0be --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512DoubleAsGeneric_Boolean.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512DoubleAsGeneric_Boolean() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512DoubleAsGeneric_Boolean: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512Int16AsGeneric_Boolean.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512Int16AsGeneric_Boolean.cs new file mode 100644 index 00000000000000..4fcacd0c76734c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512Int16AsGeneric_Boolean.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512Int16AsGeneric_Boolean() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512Int16AsGeneric_Boolean: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512Int32AsGeneric_Boolean.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512Int32AsGeneric_Boolean.cs new file mode 100644 index 00000000000000..b015da5df058a5 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512Int32AsGeneric_Boolean.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512Int32AsGeneric_Boolean() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512Int32AsGeneric_Boolean: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512Int64AsGeneric_Boolean.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512Int64AsGeneric_Boolean.cs new file mode 100644 index 00000000000000..653221e4fdb3af --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512Int64AsGeneric_Boolean.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512Int64AsGeneric_Boolean() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512Int64AsGeneric_Boolean: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512SByteAsGeneric_Boolean.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512SByteAsGeneric_Boolean.cs new file mode 100644 index 00000000000000..38ee5fa562ed6c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512SByteAsGeneric_Boolean.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512SByteAsGeneric_Boolean() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512SByteAsGeneric_Boolean: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512SingleAsGeneric_Boolean.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512SingleAsGeneric_Boolean.cs new file mode 100644 index 00000000000000..8d993ff08ad52a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512SingleAsGeneric_Boolean.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512SingleAsGeneric_Boolean() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512SingleAsGeneric_Boolean: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512UInt16AsGeneric_Boolean.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512UInt16AsGeneric_Boolean.cs new file mode 100644 index 00000000000000..9e45fdabdf2526 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512UInt16AsGeneric_Boolean.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512UInt16AsGeneric_Boolean() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512UInt16AsGeneric_Boolean: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512UInt32AsGeneric_Boolean.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512UInt32AsGeneric_Boolean.cs new file mode 100644 index 00000000000000..424b54000f3034 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512UInt32AsGeneric_Boolean.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512UInt32AsGeneric_Boolean() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512UInt32AsGeneric_Boolean: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512UInt64AsGeneric_Boolean.cs b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512UInt64AsGeneric_Boolean.cs new file mode 100644 index 00000000000000..6746594272516b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector512UInt64AsGeneric_Boolean.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._NotSupported +{ + public static partial class Program + { + [Fact] + public static void Vector512UInt64AsGeneric_Boolean() + { + bool succeeded = false; + + try + { + Vector512 result = default(Vector512).As(); + } + catch (NotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512UInt64AsGeneric_Boolean: RunNotSupportedScenario failed to throw NotSupportedException."); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs index a8ff5b209389ea..a51281d6c08915 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs @@ -18,7 +18,6 @@ namespace JIT.HardwareIntrinsics.General._Vector128 { public static partial class Program { - [ActiveIssue("https://github.com/dotnet/runtime/issues/75791")] [Fact] public static void DotSingle() { diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/Program.Vector128_1.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/Program.Vector128_1.cs index 5bd034ce1e0be5..e19a918ef55b60 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/Program.Vector128_1.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/Program.Vector128_1.cs @@ -3,9 +3,6 @@ using System; using System.Collections.Generic; -using Xunit; - -[assembly:ActiveIssue("https://github.com/dotnet/runtime/issues/54122", TestPlatforms.Browser)] namespace JIT.HardwareIntrinsics.General._Vector128_1 { diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.Int64.cs index 8b8235774162a2..fa1aca4d1a4e9a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.Int64.cs @@ -287,7 +287,6 @@ private void ValidateResult(Int64[] firstOp, Double[] result, [CallerMemberName] if (result[0] != (double)(firstOp[0])) { - Environment.FailFast("Temporary instrumentation to diagnose https://github.com/dotnet/runtime/issues/76280"); succeeded = false; } else @@ -296,7 +295,6 @@ private void ValidateResult(Int64[] firstOp, Double[] result, [CallerMemberName] { if (result[i] != (double)(firstOp[i])) { - Environment.FailFast("Temporary instrumentation to diagnose https://github.com/dotnet/runtime/issues/76280"); succeeded = false; break; } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.UInt64.cs index dde1d66100bc4d..1643320662228f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.UInt64.cs @@ -287,7 +287,6 @@ private void ValidateResult(UInt64[] firstOp, Double[] result, [CallerMemberName if (result[0] != (double)(firstOp[0])) { - Environment.FailFast("Temporary instrumentation to diagnose https://github.com/dotnet/runtime/issues/76280"); succeeded = false; } else @@ -296,7 +295,6 @@ private void ValidateResult(UInt64[] firstOp, Double[] result, [CallerMemberName { if (result[i] != (double)(firstOp[i])) { - Environment.FailFast("Temporary instrumentation to diagnose https://github.com/dotnet/runtime/issues/76280"); succeeded = false; break; } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs index eb9cf19f744f0a..6b549c036f71cd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs @@ -18,7 +18,6 @@ namespace JIT.HardwareIntrinsics.General._Vector256 { public static partial class Program { - [ActiveIssue("https://github.com/dotnet/runtime/issues/75791")] [Fact] public static void DotSingle() { diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Program.Vector256_1.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Program.Vector256_1.cs index bfccc8223160a7..4b66bda1b1c0bf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Program.Vector256_1.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Program.Vector256_1.cs @@ -3,9 +3,6 @@ using System; using System.Collections.Generic; -using Xunit; - -[assembly:ActiveIssue("https://github.com/dotnet/runtime/issues/54122", TestPlatforms.Browser)] namespace JIT.HardwareIntrinsics.General._Vector256_1 { diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_r.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_r.csproj index 30f75cff13bc91..e5621240814339 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_r.csproj +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_r.csproj @@ -2,10 +2,6 @@ false true - - - true - true Embedded diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_ro.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_ro.csproj index e2935da1b9475a..1878d6f25f9333 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_ro.csproj +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_ro.csproj @@ -2,10 +2,6 @@ false true - - - true - true Embedded diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Byte.cs new file mode 100644 index 00000000000000..05f230544ffa55 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Byte.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AbsByte() + { + var test = new VectorUnaryOpTest__AbsByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__AbsByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__AbsByte testClass) + { + var result = Vector512.Abs(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__AbsByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__AbsByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Abs( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Abs( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Abs(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__AbsByte(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Abs(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Byte[] firstOp, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != firstOp[0]) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != firstOp[i]) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Abs)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Double.cs new file mode 100644 index 00000000000000..97cb53e84688d1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Double.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AbsDouble() + { + var test = new VectorUnaryOpTest__AbsDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__AbsDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__AbsDouble testClass) + { + var result = Vector512.Abs(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__AbsDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__AbsDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Abs( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Abs( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Abs(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__AbsDouble(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Abs(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != Math.Abs(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != Math.Abs(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Abs)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int16.cs new file mode 100644 index 00000000000000..c3931987203fe0 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int16.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AbsInt16() + { + var test = new VectorUnaryOpTest__AbsInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__AbsInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__AbsInt16 testClass) + { + var result = Vector512.Abs(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__AbsInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__AbsInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Abs( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Abs( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Abs(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__AbsInt16(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Abs(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != Math.Abs(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != Math.Abs(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Abs)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int32.cs new file mode 100644 index 00000000000000..92b27ff3b50ea3 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int32.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AbsInt32() + { + var test = new VectorUnaryOpTest__AbsInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__AbsInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__AbsInt32 testClass) + { + var result = Vector512.Abs(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__AbsInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__AbsInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Abs( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Abs( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Abs(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__AbsInt32(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Abs(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != Math.Abs(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != Math.Abs(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Abs)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int64.cs new file mode 100644 index 00000000000000..34241bea731ee7 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int64.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AbsInt64() + { + var test = new VectorUnaryOpTest__AbsInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__AbsInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__AbsInt64 testClass) + { + var result = Vector512.Abs(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__AbsInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__AbsInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Abs( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Abs( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Abs(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__AbsInt64(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Abs(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int64[] firstOp, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != Math.Abs(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != Math.Abs(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Abs)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.SByte.cs new file mode 100644 index 00000000000000..830233ca449655 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.SByte.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AbsSByte() + { + var test = new VectorUnaryOpTest__AbsSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__AbsSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__AbsSByte testClass) + { + var result = Vector512.Abs(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__AbsSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__AbsSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Abs( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Abs( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Abs(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__AbsSByte(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Abs(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(SByte[] firstOp, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != Math.Abs(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != Math.Abs(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Abs)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Single.cs new file mode 100644 index 00000000000000..8975f62db45675 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Single.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AbsSingle() + { + var test = new VectorUnaryOpTest__AbsSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__AbsSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__AbsSingle testClass) + { + var result = Vector512.Abs(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__AbsSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__AbsSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Abs( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Abs( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Abs(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__AbsSingle(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Abs(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != Math.Abs(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != Math.Abs(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Abs)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt16.cs new file mode 100644 index 00000000000000..979d4f22f9e448 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt16.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AbsUInt16() + { + var test = new VectorUnaryOpTest__AbsUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__AbsUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__AbsUInt16 testClass) + { + var result = Vector512.Abs(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__AbsUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__AbsUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Abs( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Abs( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Abs(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__AbsUInt16(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Abs(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt16[] firstOp, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != firstOp[0]) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != firstOp[i]) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Abs)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt32.cs new file mode 100644 index 00000000000000..45b017fc702bb1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt32.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AbsUInt32() + { + var test = new VectorUnaryOpTest__AbsUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__AbsUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__AbsUInt32 testClass) + { + var result = Vector512.Abs(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__AbsUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__AbsUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Abs( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Abs( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Abs(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__AbsUInt32(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Abs(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != firstOp[0]) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != firstOp[i]) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Abs)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt64.cs new file mode 100644 index 00000000000000..8fa01e60dd303f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt64.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AbsUInt64() + { + var test = new VectorUnaryOpTest__AbsUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__AbsUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__AbsUInt64 testClass) + { + var result = Vector512.Abs(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__AbsUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__AbsUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Abs( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Abs), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Abs( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Abs(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__AbsUInt64(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Abs(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Abs(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt64[] firstOp, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != firstOp[0]) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != firstOp[i]) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Abs)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Byte.cs new file mode 100644 index 00000000000000..7f37bdbe8537c9 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Byte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AddByte() + { + var test = new VectorBinaryOpTest__AddByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AddByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AddByte testClass) + { + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AddByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AddByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Add( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Add), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Add), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Add( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Add(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AddByte(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Add)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Double.cs new file mode 100644 index 00000000000000..02bf624ca4ebdd --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Double.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AddDouble() + { + var test = new VectorBinaryOpTest__AddDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AddDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AddDouble testClass) + { + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AddDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AddDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Add( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Add), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Add), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Add( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Add(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AddDouble(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (double)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (double)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Add)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int16.cs new file mode 100644 index 00000000000000..a4ec5ba363d832 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AddInt16() + { + var test = new VectorBinaryOpTest__AddInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AddInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AddInt16 testClass) + { + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AddInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AddInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Add( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Add), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Add), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Add( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Add(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AddInt16(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Add)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int32.cs new file mode 100644 index 00000000000000..d791d701985ad4 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AddInt32() + { + var test = new VectorBinaryOpTest__AddInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AddInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AddInt32 testClass) + { + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AddInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AddInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Add( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Add), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Add), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Add( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Add(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AddInt32(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Add)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int64.cs new file mode 100644 index 00000000000000..870e1829ebe150 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AddInt64() + { + var test = new VectorBinaryOpTest__AddInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AddInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AddInt64 testClass) + { + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AddInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AddInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Add( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Add), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Add), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Add( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Add(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AddInt64(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Add)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.SByte.cs new file mode 100644 index 00000000000000..bbc7cfde4f8015 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.SByte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AddSByte() + { + var test = new VectorBinaryOpTest__AddSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AddSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AddSByte testClass) + { + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AddSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AddSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Add( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Add), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Add), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Add( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Add(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AddSByte(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Add)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Single.cs new file mode 100644 index 00000000000000..49460b1668776a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Single.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AddSingle() + { + var test = new VectorBinaryOpTest__AddSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AddSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AddSingle testClass) + { + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AddSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AddSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Add( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Add), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Add), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Add( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Add(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AddSingle(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (float)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (float)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Add)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt16.cs new file mode 100644 index 00000000000000..2a228017905873 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AddUInt16() + { + var test = new VectorBinaryOpTest__AddUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AddUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AddUInt16 testClass) + { + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AddUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AddUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Add( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Add), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Add), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Add( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Add(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AddUInt16(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Add)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt32.cs new file mode 100644 index 00000000000000..7671b7471b0c72 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AddUInt32() + { + var test = new VectorBinaryOpTest__AddUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AddUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AddUInt32 testClass) + { + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AddUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AddUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Add( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Add), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Add), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Add( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Add(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AddUInt32(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Add)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt64.cs new file mode 100644 index 00000000000000..4048b779b0f053 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AddUInt64() + { + var test = new VectorBinaryOpTest__AddUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AddUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AddUInt64 testClass) + { + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AddUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AddUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Add( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Add), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Add), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Add( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Add(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AddUInt64(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Add(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Add(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Add)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Byte.cs new file mode 100644 index 00000000000000..5d12a392a71411 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Byte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AndNotByte() + { + var test = new VectorBinaryOpTest__AndNotByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AndNotByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AndNotByte testClass) + { + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AndNotByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AndNotByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.AndNot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.AndNot( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.AndNot(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AndNotByte(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(left[0] & ~right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(left[i] & ~right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.AndNot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Double.cs new file mode 100644 index 00000000000000..9b2624470ea9bb --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Double.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AndNotDouble() + { + var test = new VectorBinaryOpTest__AndNotDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AndNotDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AndNotDouble testClass) + { + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AndNotDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AndNotDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.AndNot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.AndNot( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.AndNot(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AndNotDouble(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.DoubleToInt64Bits(result[0]) != (BitConverter.DoubleToInt64Bits(left[0]) & ~BitConverter.DoubleToInt64Bits(right[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(result[i]) != (BitConverter.DoubleToInt64Bits(left[i]) & ~BitConverter.DoubleToInt64Bits(right[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.AndNot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int16.cs new file mode 100644 index 00000000000000..7fa822f944f334 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AndNotInt16() + { + var test = new VectorBinaryOpTest__AndNotInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AndNotInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AndNotInt16 testClass) + { + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AndNotInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AndNotInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.AndNot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.AndNot( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.AndNot(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AndNotInt16(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(left[0] & ~right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(left[i] & ~right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.AndNot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int32.cs new file mode 100644 index 00000000000000..699bfa69a5ee7c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AndNotInt32() + { + var test = new VectorBinaryOpTest__AndNotInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AndNotInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AndNotInt32 testClass) + { + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AndNotInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AndNotInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.AndNot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.AndNot( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.AndNot(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AndNotInt32(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(left[0] & ~right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(left[i] & ~right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.AndNot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int64.cs new file mode 100644 index 00000000000000..e97673df36bb18 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AndNotInt64() + { + var test = new VectorBinaryOpTest__AndNotInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AndNotInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AndNotInt64 testClass) + { + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AndNotInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AndNotInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.AndNot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.AndNot( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.AndNot(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AndNotInt64(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(left[0] & ~right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(left[i] & ~right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.AndNot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.SByte.cs new file mode 100644 index 00000000000000..062cddd450e041 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.SByte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AndNotSByte() + { + var test = new VectorBinaryOpTest__AndNotSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AndNotSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AndNotSByte testClass) + { + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AndNotSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AndNotSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.AndNot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.AndNot( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.AndNot(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AndNotSByte(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(left[0] & ~right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(left[i] & ~right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.AndNot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Single.cs new file mode 100644 index 00000000000000..a6a08326bd81ce --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Single.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AndNotSingle() + { + var test = new VectorBinaryOpTest__AndNotSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AndNotSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AndNotSingle testClass) + { + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AndNotSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AndNotSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.AndNot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.AndNot( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.AndNot(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AndNotSingle(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.SingleToInt32Bits(result[0]) != (BitConverter.SingleToInt32Bits(left[0]) & ~BitConverter.SingleToInt32Bits(right[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(result[i]) != (BitConverter.SingleToInt32Bits(left[i]) & ~BitConverter.SingleToInt32Bits(right[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.AndNot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt16.cs new file mode 100644 index 00000000000000..b70db63f73b5c4 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AndNotUInt16() + { + var test = new VectorBinaryOpTest__AndNotUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AndNotUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AndNotUInt16 testClass) + { + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AndNotUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AndNotUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.AndNot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.AndNot( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.AndNot(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AndNotUInt16(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(left[0] & ~right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(left[i] & ~right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.AndNot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt32.cs new file mode 100644 index 00000000000000..838e80c454ed74 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AndNotUInt32() + { + var test = new VectorBinaryOpTest__AndNotUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AndNotUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AndNotUInt32 testClass) + { + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AndNotUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AndNotUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.AndNot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.AndNot( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.AndNot(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AndNotUInt32(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(left[0] & ~right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(left[i] & ~right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.AndNot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt64.cs new file mode 100644 index 00000000000000..f2190b1978fda7 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void AndNotUInt64() + { + var test = new VectorBinaryOpTest__AndNotUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__AndNotUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__AndNotUInt64 testClass) + { + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__AndNotUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__AndNotUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.AndNot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.AndNot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.AndNot( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.AndNot(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__AndNotUInt64(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.AndNot(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.AndNot(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(left[0] & ~right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(left[i] & ~right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.AndNot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Byte.cs new file mode 100644 index 00000000000000..a7bd35e5f70107 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Byte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseAndByte() + { + var test = new VectorBinaryOpTest__BitwiseAndByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseAndByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseAndByte testClass) + { + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseAndByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseAndByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseAnd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseAnd( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseAnd(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseAndByte(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(left[0] & right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(left[i] & right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseAnd)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Double.cs new file mode 100644 index 00000000000000..677d5e444de581 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Double.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseAndDouble() + { + var test = new VectorBinaryOpTest__BitwiseAndDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseAndDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseAndDouble testClass) + { + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseAndDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseAndDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseAnd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseAnd( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseAnd(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseAndDouble(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.DoubleToInt64Bits(result[0]) != (BitConverter.DoubleToInt64Bits(left[0]) & BitConverter.DoubleToInt64Bits(right[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(result[i]) != (BitConverter.DoubleToInt64Bits(left[i]) & BitConverter.DoubleToInt64Bits(right[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseAnd)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int16.cs new file mode 100644 index 00000000000000..66a394590d4597 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseAndInt16() + { + var test = new VectorBinaryOpTest__BitwiseAndInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseAndInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseAndInt16 testClass) + { + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseAndInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseAndInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseAnd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseAnd( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseAnd(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseAndInt16(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(left[0] & right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(left[i] & right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseAnd)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int32.cs new file mode 100644 index 00000000000000..febb3c8b1b4dbc --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseAndInt32() + { + var test = new VectorBinaryOpTest__BitwiseAndInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseAndInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseAndInt32 testClass) + { + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseAndInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseAndInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseAnd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseAnd( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseAnd(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseAndInt32(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(left[0] & right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(left[i] & right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseAnd)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int64.cs new file mode 100644 index 00000000000000..8ce669158c554d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseAndInt64() + { + var test = new VectorBinaryOpTest__BitwiseAndInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseAndInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseAndInt64 testClass) + { + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseAndInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseAndInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseAnd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseAnd( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseAnd(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseAndInt64(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(left[0] & right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(left[i] & right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseAnd)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.SByte.cs new file mode 100644 index 00000000000000..cc5d15876e52fb --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.SByte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseAndSByte() + { + var test = new VectorBinaryOpTest__BitwiseAndSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseAndSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseAndSByte testClass) + { + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseAndSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseAndSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseAnd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseAnd( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseAnd(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseAndSByte(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(left[0] & right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(left[i] & right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseAnd)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Single.cs new file mode 100644 index 00000000000000..85f531c7982076 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Single.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseAndSingle() + { + var test = new VectorBinaryOpTest__BitwiseAndSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseAndSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseAndSingle testClass) + { + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseAndSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseAndSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseAnd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseAnd( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseAnd(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseAndSingle(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.SingleToInt32Bits(result[0]) != (BitConverter.SingleToInt32Bits(left[0]) & BitConverter.SingleToInt32Bits(right[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(result[i]) != (BitConverter.SingleToInt32Bits(left[i]) & BitConverter.SingleToInt32Bits(right[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseAnd)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt16.cs new file mode 100644 index 00000000000000..7ea0a31f16398c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseAndUInt16() + { + var test = new VectorBinaryOpTest__BitwiseAndUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseAndUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseAndUInt16 testClass) + { + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseAndUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseAndUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseAnd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseAnd( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseAnd(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseAndUInt16(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(left[0] & right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(left[i] & right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseAnd)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt32.cs new file mode 100644 index 00000000000000..b435d89af9c44d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseAndUInt32() + { + var test = new VectorBinaryOpTest__BitwiseAndUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseAndUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseAndUInt32 testClass) + { + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseAndUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseAndUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseAnd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseAnd( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseAnd(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseAndUInt32(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(left[0] & right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(left[i] & right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseAnd)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt64.cs new file mode 100644 index 00000000000000..7ef3bd6a92b645 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseAndUInt64() + { + var test = new VectorBinaryOpTest__BitwiseAndUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseAndUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseAndUInt64 testClass) + { + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseAndUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseAndUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseAnd( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseAnd), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseAnd( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseAnd(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseAndUInt64(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseAnd(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseAnd(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(left[0] & right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(left[i] & right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseAnd)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Byte.cs new file mode 100644 index 00000000000000..227d3aaca27919 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Byte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseOrByte() + { + var test = new VectorBinaryOpTest__BitwiseOrByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseOrByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseOrByte testClass) + { + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseOrByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseOrByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseOr( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseOr( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseOr(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseOrByte(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(left[0] | right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(left[i] | right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseOr)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Double.cs new file mode 100644 index 00000000000000..647ab757914a31 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Double.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseOrDouble() + { + var test = new VectorBinaryOpTest__BitwiseOrDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseOrDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseOrDouble testClass) + { + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseOrDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseOrDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseOr( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseOr( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseOr(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseOrDouble(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.DoubleToInt64Bits(result[0]) != (BitConverter.DoubleToInt64Bits(left[0]) | BitConverter.DoubleToInt64Bits(right[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(result[i]) != (BitConverter.DoubleToInt64Bits(left[i]) | BitConverter.DoubleToInt64Bits(right[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseOr)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int16.cs new file mode 100644 index 00000000000000..e8e4dad3624f85 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseOrInt16() + { + var test = new VectorBinaryOpTest__BitwiseOrInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseOrInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseOrInt16 testClass) + { + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseOrInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseOrInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseOr( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseOr( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseOr(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseOrInt16(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(left[0] | right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(left[i] | right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseOr)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int32.cs new file mode 100644 index 00000000000000..fb52e460ced277 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseOrInt32() + { + var test = new VectorBinaryOpTest__BitwiseOrInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseOrInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseOrInt32 testClass) + { + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseOrInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseOrInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseOr( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseOr( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseOr(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseOrInt32(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(left[0] | right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(left[i] | right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseOr)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int64.cs new file mode 100644 index 00000000000000..0c9184b106fc12 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseOrInt64() + { + var test = new VectorBinaryOpTest__BitwiseOrInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseOrInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseOrInt64 testClass) + { + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseOrInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseOrInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseOr( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseOr( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseOr(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseOrInt64(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(left[0] | right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(left[i] | right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseOr)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.SByte.cs new file mode 100644 index 00000000000000..0fa9be06cbefe1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.SByte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseOrSByte() + { + var test = new VectorBinaryOpTest__BitwiseOrSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseOrSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseOrSByte testClass) + { + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseOrSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseOrSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseOr( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseOr( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseOr(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseOrSByte(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(left[0] | right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(left[i] | right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseOr)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Single.cs new file mode 100644 index 00000000000000..ecac79ce3ea391 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Single.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseOrSingle() + { + var test = new VectorBinaryOpTest__BitwiseOrSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseOrSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseOrSingle testClass) + { + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseOrSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseOrSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseOr( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseOr( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseOr(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseOrSingle(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.SingleToInt32Bits(result[0]) != (BitConverter.SingleToInt32Bits(left[0]) | BitConverter.SingleToInt32Bits(right[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(result[i]) != (BitConverter.SingleToInt32Bits(left[i]) | BitConverter.SingleToInt32Bits(right[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseOr)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt16.cs new file mode 100644 index 00000000000000..e2c5b81620c736 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseOrUInt16() + { + var test = new VectorBinaryOpTest__BitwiseOrUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseOrUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseOrUInt16 testClass) + { + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseOrUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseOrUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseOr( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseOr( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseOr(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseOrUInt16(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(left[0] | right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(left[i] | right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseOr)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt32.cs new file mode 100644 index 00000000000000..5cae6cf5cac123 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseOrUInt32() + { + var test = new VectorBinaryOpTest__BitwiseOrUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseOrUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseOrUInt32 testClass) + { + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseOrUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseOrUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseOr( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseOr( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseOr(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseOrUInt32(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(left[0] | right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(left[i] | right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseOr)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt64.cs new file mode 100644 index 00000000000000..52ab723c1c5d19 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void BitwiseOrUInt64() + { + var test = new VectorBinaryOpTest__BitwiseOrUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__BitwiseOrUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__BitwiseOrUInt64 testClass) + { + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__BitwiseOrUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__BitwiseOrUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.BitwiseOr( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.BitwiseOr), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.BitwiseOr( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.BitwiseOr(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__BitwiseOrUInt64(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.BitwiseOr(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.BitwiseOr(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(left[0] | right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(left[i] | right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.BitwiseOr)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Double.cs new file mode 100644 index 00000000000000..fb4efa275f0fcc --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Double.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CeilingDouble() + { + var test = new VectorUnaryOpTest__CeilingDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__CeilingDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__CeilingDouble testClass) + { + var result = Vector512.Ceiling(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__CeilingDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__CeilingDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Ceiling( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Ceiling), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Ceiling), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Ceiling( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Ceiling(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__CeilingDouble(); + var result = Vector512.Ceiling(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Ceiling(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Ceiling(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != Math.Ceiling(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != Math.Ceiling(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Ceiling)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Single.cs new file mode 100644 index 00000000000000..4a9899ddaeed48 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Single.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CeilingSingle() + { + var test = new VectorUnaryOpTest__CeilingSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__CeilingSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__CeilingSingle testClass) + { + var result = Vector512.Ceiling(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__CeilingSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__CeilingSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Ceiling( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Ceiling), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Ceiling), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Ceiling( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Ceiling(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__CeilingSingle(); + var result = Vector512.Ceiling(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Ceiling(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Ceiling(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != MathF.Ceiling(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != MathF.Ceiling(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Ceiling)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Byte.cs new file mode 100644 index 00000000000000..e09a1e6ab85063 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Byte.cs @@ -0,0 +1,377 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void ConditionalSelectByte() + { + var test = new VectorTernaryOpTest__ConditionalSelectByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorTernaryOpTest__ConditionalSelectByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] inArray3, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + public Vector512 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorTernaryOpTest__ConditionalSelectByte testClass) + { + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + private static Byte[] _data3 = new Byte[Op3ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + private static Vector512 _clsVar3; + + private Vector512 _fld1; + private Vector512 _fld2; + private Vector512 _fld3; + + private DataTable _dataTable; + + static VectorTernaryOpTest__ConditionalSelectByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorTernaryOpTest__ConditionalSelectByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.ConditionalSelect( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), new Type[] { + typeof(Vector512), + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.ConditionalSelect( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Vector512.ConditionalSelect(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorTernaryOpTest__ConditionalSelectByte(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, Vector512 op3, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Byte[] firstOp, Byte[] secondOp, Byte[] thirdOp, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)((secondOp[0] & firstOp[0]) | (thirdOp[0] & ~firstOp[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)((secondOp[i] & firstOp[i]) | (thirdOp[i] & ~firstOp[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.ConditionalSelect)}(Vector512, Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Double.cs new file mode 100644 index 00000000000000..09c7a358f15d27 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Double.cs @@ -0,0 +1,377 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void ConditionalSelectDouble() + { + var test = new VectorTernaryOpTest__ConditionalSelectDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorTernaryOpTest__ConditionalSelectDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] inArray3, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + public Vector512 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorTernaryOpTest__ConditionalSelectDouble testClass) + { + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + private static Double[] _data3 = new Double[Op3ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + private static Vector512 _clsVar3; + + private Vector512 _fld1; + private Vector512 _fld2; + private Vector512 _fld3; + + private DataTable _dataTable; + + static VectorTernaryOpTest__ConditionalSelectDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorTernaryOpTest__ConditionalSelectDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.ConditionalSelect( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), new Type[] { + typeof(Vector512), + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.ConditionalSelect( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Vector512.ConditionalSelect(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorTernaryOpTest__ConditionalSelectDouble(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, Vector512 op3, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] inArray3 = new Double[Op3ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] inArray3 = new Double[Op3ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] secondOp, Double[] thirdOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.DoubleToInt64Bits(result[0]) != ((BitConverter.DoubleToInt64Bits(secondOp[0]) & BitConverter.DoubleToInt64Bits(firstOp[0])) | (BitConverter.DoubleToInt64Bits(thirdOp[0]) & ~BitConverter.DoubleToInt64Bits(firstOp[0])))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(result[i]) != ((BitConverter.DoubleToInt64Bits(secondOp[i]) & BitConverter.DoubleToInt64Bits(firstOp[i])) | (BitConverter.DoubleToInt64Bits(thirdOp[i]) & ~BitConverter.DoubleToInt64Bits(firstOp[i])))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.ConditionalSelect)}(Vector512, Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int16.cs new file mode 100644 index 00000000000000..4de3fb51773255 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int16.cs @@ -0,0 +1,377 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void ConditionalSelectInt16() + { + var test = new VectorTernaryOpTest__ConditionalSelectInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorTernaryOpTest__ConditionalSelectInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + public Vector512 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorTernaryOpTest__ConditionalSelectInt16 testClass) + { + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + private static Vector512 _clsVar3; + + private Vector512 _fld1; + private Vector512 _fld2; + private Vector512 _fld3; + + private DataTable _dataTable; + + static VectorTernaryOpTest__ConditionalSelectInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorTernaryOpTest__ConditionalSelectInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.ConditionalSelect( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), new Type[] { + typeof(Vector512), + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.ConditionalSelect( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Vector512.ConditionalSelect(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorTernaryOpTest__ConditionalSelectInt16(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, Vector512 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)((secondOp[0] & firstOp[0]) | (thirdOp[0] & ~firstOp[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)((secondOp[i] & firstOp[i]) | (thirdOp[i] & ~firstOp[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.ConditionalSelect)}(Vector512, Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int32.cs new file mode 100644 index 00000000000000..2aaf1331037499 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int32.cs @@ -0,0 +1,377 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void ConditionalSelectInt32() + { + var test = new VectorTernaryOpTest__ConditionalSelectInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorTernaryOpTest__ConditionalSelectInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + public Vector512 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorTernaryOpTest__ConditionalSelectInt32 testClass) + { + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + private static Vector512 _clsVar3; + + private Vector512 _fld1; + private Vector512 _fld2; + private Vector512 _fld3; + + private DataTable _dataTable; + + static VectorTernaryOpTest__ConditionalSelectInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorTernaryOpTest__ConditionalSelectInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.ConditionalSelect( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), new Type[] { + typeof(Vector512), + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.ConditionalSelect( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Vector512.ConditionalSelect(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorTernaryOpTest__ConditionalSelectInt32(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, Vector512 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)((secondOp[0] & firstOp[0]) | (thirdOp[0] & ~firstOp[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)((secondOp[i] & firstOp[i]) | (thirdOp[i] & ~firstOp[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.ConditionalSelect)}(Vector512, Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int64.cs new file mode 100644 index 00000000000000..cbc108a87b5229 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int64.cs @@ -0,0 +1,377 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void ConditionalSelectInt64() + { + var test = new VectorTernaryOpTest__ConditionalSelectInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorTernaryOpTest__ConditionalSelectInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] inArray3, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + public Vector512 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorTernaryOpTest__ConditionalSelectInt64 testClass) + { + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + private static Int64[] _data3 = new Int64[Op3ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + private static Vector512 _clsVar3; + + private Vector512 _fld1; + private Vector512 _fld2; + private Vector512 _fld3; + + private DataTable _dataTable; + + static VectorTernaryOpTest__ConditionalSelectInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorTernaryOpTest__ConditionalSelectInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.ConditionalSelect( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), new Type[] { + typeof(Vector512), + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.ConditionalSelect( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Vector512.ConditionalSelect(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorTernaryOpTest__ConditionalSelectInt64(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, Vector512 op3, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] inArray3 = new Int64[Op3ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] inArray3 = new Int64[Op3ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int64[] firstOp, Int64[] secondOp, Int64[] thirdOp, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)((secondOp[0] & firstOp[0]) | (thirdOp[0] & ~firstOp[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)((secondOp[i] & firstOp[i]) | (thirdOp[i] & ~firstOp[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.ConditionalSelect)}(Vector512, Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.SByte.cs new file mode 100644 index 00000000000000..ca832d8f136884 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.SByte.cs @@ -0,0 +1,377 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void ConditionalSelectSByte() + { + var test = new VectorTernaryOpTest__ConditionalSelectSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorTernaryOpTest__ConditionalSelectSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] inArray3, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + public Vector512 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorTernaryOpTest__ConditionalSelectSByte testClass) + { + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + private static SByte[] _data3 = new SByte[Op3ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + private static Vector512 _clsVar3; + + private Vector512 _fld1; + private Vector512 _fld2; + private Vector512 _fld3; + + private DataTable _dataTable; + + static VectorTernaryOpTest__ConditionalSelectSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorTernaryOpTest__ConditionalSelectSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.ConditionalSelect( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), new Type[] { + typeof(Vector512), + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.ConditionalSelect( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Vector512.ConditionalSelect(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorTernaryOpTest__ConditionalSelectSByte(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, Vector512 op3, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(SByte[] firstOp, SByte[] secondOp, SByte[] thirdOp, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)((secondOp[0] & firstOp[0]) | (thirdOp[0] & ~firstOp[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)((secondOp[i] & firstOp[i]) | (thirdOp[i] & ~firstOp[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.ConditionalSelect)}(Vector512, Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Single.cs new file mode 100644 index 00000000000000..4ca83dae159053 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Single.cs @@ -0,0 +1,377 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void ConditionalSelectSingle() + { + var test = new VectorTernaryOpTest__ConditionalSelectSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorTernaryOpTest__ConditionalSelectSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + public Vector512 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorTernaryOpTest__ConditionalSelectSingle testClass) + { + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + private static Single[] _data3 = new Single[Op3ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + private static Vector512 _clsVar3; + + private Vector512 _fld1; + private Vector512 _fld2; + private Vector512 _fld3; + + private DataTable _dataTable; + + static VectorTernaryOpTest__ConditionalSelectSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorTernaryOpTest__ConditionalSelectSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + 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 DataTable(_data1, _data2, _data3, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.ConditionalSelect( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), new Type[] { + typeof(Vector512), + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.ConditionalSelect( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Vector512.ConditionalSelect(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorTernaryOpTest__ConditionalSelectSingle(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, Vector512 op3, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] inArray3 = new Single[Op3ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] inArray3 = new Single[Op3ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] secondOp, Single[] thirdOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.SingleToInt32Bits(result[0]) != ((BitConverter.SingleToInt32Bits(secondOp[0]) & BitConverter.SingleToInt32Bits(firstOp[0])) | (BitConverter.SingleToInt32Bits(thirdOp[0]) & ~BitConverter.SingleToInt32Bits(firstOp[0])))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(result[i]) != ((BitConverter.SingleToInt32Bits(secondOp[i]) & BitConverter.SingleToInt32Bits(firstOp[i])) | (BitConverter.SingleToInt32Bits(thirdOp[i]) & ~BitConverter.SingleToInt32Bits(firstOp[i])))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.ConditionalSelect)}(Vector512, Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt16.cs new file mode 100644 index 00000000000000..89cebe785b6a4d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt16.cs @@ -0,0 +1,377 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void ConditionalSelectUInt16() + { + var test = new VectorTernaryOpTest__ConditionalSelectUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorTernaryOpTest__ConditionalSelectUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] inArray3, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + public Vector512 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorTernaryOpTest__ConditionalSelectUInt16 testClass) + { + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + private static UInt16[] _data3 = new UInt16[Op3ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + private static Vector512 _clsVar3; + + private Vector512 _fld1; + private Vector512 _fld2; + private Vector512 _fld3; + + private DataTable _dataTable; + + static VectorTernaryOpTest__ConditionalSelectUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorTernaryOpTest__ConditionalSelectUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.ConditionalSelect( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), new Type[] { + typeof(Vector512), + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.ConditionalSelect( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Vector512.ConditionalSelect(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorTernaryOpTest__ConditionalSelectUInt16(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, Vector512 op3, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] inArray3 = new UInt16[Op3ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] inArray3 = new UInt16[Op3ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(UInt16[] firstOp, UInt16[] secondOp, UInt16[] thirdOp, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)((secondOp[0] & firstOp[0]) | (thirdOp[0] & ~firstOp[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)((secondOp[i] & firstOp[i]) | (thirdOp[i] & ~firstOp[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.ConditionalSelect)}(Vector512, Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt32.cs new file mode 100644 index 00000000000000..8c64b3a6b4d6c6 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt32.cs @@ -0,0 +1,377 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void ConditionalSelectUInt32() + { + var test = new VectorTernaryOpTest__ConditionalSelectUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorTernaryOpTest__ConditionalSelectUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] inArray3, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + public Vector512 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorTernaryOpTest__ConditionalSelectUInt32 testClass) + { + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + private static UInt32[] _data3 = new UInt32[Op3ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + private static Vector512 _clsVar3; + + private Vector512 _fld1; + private Vector512 _fld2; + private Vector512 _fld3; + + private DataTable _dataTable; + + static VectorTernaryOpTest__ConditionalSelectUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorTernaryOpTest__ConditionalSelectUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.ConditionalSelect( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), new Type[] { + typeof(Vector512), + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.ConditionalSelect( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Vector512.ConditionalSelect(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorTernaryOpTest__ConditionalSelectUInt32(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, Vector512 op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] inArray3 = new UInt32[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] inArray3 = new UInt32[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, UInt32[] secondOp, UInt32[] thirdOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)((secondOp[0] & firstOp[0]) | (thirdOp[0] & ~firstOp[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)((secondOp[i] & firstOp[i]) | (thirdOp[i] & ~firstOp[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.ConditionalSelect)}(Vector512, Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt64.cs new file mode 100644 index 00000000000000..eccf95255def89 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt64.cs @@ -0,0 +1,377 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void ConditionalSelectUInt64() + { + var test = new VectorTernaryOpTest__ConditionalSelectUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorTernaryOpTest__ConditionalSelectUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] inArray3, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + public Vector512 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorTernaryOpTest__ConditionalSelectUInt64 testClass) + { + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + private static UInt64[] _data3 = new UInt64[Op3ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + private static Vector512 _clsVar3; + + private Vector512 _fld1; + private Vector512 _fld2; + private Vector512 _fld3; + + private DataTable _dataTable; + + static VectorTernaryOpTest__ConditionalSelectUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorTernaryOpTest__ConditionalSelectUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, _data3, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.ConditionalSelect( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), new Type[] { + typeof(Vector512), + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.ConditionalSelect), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.ConditionalSelect( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Vector512.ConditionalSelect(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorTernaryOpTest__ConditionalSelectUInt64(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.ConditionalSelect(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.ConditionalSelect(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, Vector512 op3, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] inArray3 = new UInt64[Op3ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] inArray3 = new UInt64[Op3ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(UInt64[] firstOp, UInt64[] secondOp, UInt64[] thirdOp, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)((secondOp[0] & firstOp[0]) | (thirdOp[0] & ~firstOp[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)((secondOp[i] & firstOp[i]) | (thirdOp[i] & ~firstOp[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.ConditionalSelect)}(Vector512, Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.Int64.cs new file mode 100644 index 00000000000000..cddec86971ede4 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.Int64.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void ConvertToDoubleInt64() + { + var test = new VectorUnaryOpTest__ConvertToDoubleInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__ConvertToDoubleInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__ConvertToDoubleInt64 testClass) + { + var result = Vector512.ConvertToDouble(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__ConvertToDoubleInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__ConvertToDoubleInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.ConvertToDouble( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.ConvertToDouble), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.ConvertToDouble), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.ConvertToDouble( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.ConvertToDouble(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__ConvertToDoubleInt64(); + var result = Vector512.ConvertToDouble(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.ConvertToDouble(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.ConvertToDouble(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int64[] firstOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (double)(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (double)(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.ConvertToDouble)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.UInt64.cs new file mode 100644 index 00000000000000..619dcc65eb6dc6 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.UInt64.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void ConvertToDoubleUInt64() + { + var test = new VectorUnaryOpTest__ConvertToDoubleUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__ConvertToDoubleUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = Math.Min(long.MaxValue, TestLibrary.Generator.GetUInt64()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__ConvertToDoubleUInt64 testClass) + { + var result = Vector512.ConvertToDouble(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__ConvertToDoubleUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = Math.Min(long.MaxValue, TestLibrary.Generator.GetUInt64()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__ConvertToDoubleUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = Math.Min(long.MaxValue, TestLibrary.Generator.GetUInt64()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = Math.Min(long.MaxValue, TestLibrary.Generator.GetUInt64()); } + _dataTable = new DataTable(_data1, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.ConvertToDouble( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.ConvertToDouble), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.ConvertToDouble), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.ConvertToDouble( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.ConvertToDouble(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__ConvertToDoubleUInt64(); + var result = Vector512.ConvertToDouble(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.ConvertToDouble(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.ConvertToDouble(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt64[] firstOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (double)(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (double)(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.ConvertToDouble)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt32.Single.cs new file mode 100644 index 00000000000000..0ca88929d86c2d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt32.Single.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void ConvertToInt32Single() + { + var test = new VectorUnaryOpTest__ConvertToInt32Single(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__ConvertToInt32Single + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__ConvertToInt32Single testClass) + { + var result = Vector512.ConvertToInt32(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Single[] _data1 = new Single[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__ConvertToInt32Single() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__ConvertToInt32Single() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.ConvertToInt32( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.ConvertToInt32), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.ConvertToInt32), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.ConvertToInt32( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.ConvertToInt32(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__ConvertToInt32Single(); + var result = Vector512.ConvertToInt32(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.ConvertToInt32(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.ConvertToInt32(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.ConvertToInt32)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt64.Double.cs new file mode 100644 index 00000000000000..d97d8290b7fe60 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt64.Double.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void ConvertToInt64Double() + { + var test = new VectorUnaryOpTest__ConvertToInt64Double(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__ConvertToInt64Double + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__ConvertToInt64Double testClass) + { + var result = Vector512.ConvertToInt64(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Double[] _data1 = new Double[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__ConvertToInt64Double() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__ConvertToInt64Double() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.ConvertToInt64( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.ConvertToInt64), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.ConvertToInt64), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.ConvertToInt64( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.ConvertToInt64(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__ConvertToInt64Double(); + var result = Vector512.ConvertToInt64(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.ConvertToInt64(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.ConvertToInt64(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.ConvertToInt64)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.Int32.cs new file mode 100644 index 00000000000000..7b4c64a2b68273 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.Int32.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void ConvertToSingleInt32() + { + var test = new VectorUnaryOpTest__ConvertToSingleInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__ConvertToSingleInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__ConvertToSingleInt32 testClass) + { + var result = Vector512.ConvertToSingle(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__ConvertToSingleInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__ConvertToSingleInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.ConvertToSingle( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.ConvertToSingle), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.ConvertToSingle), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.ConvertToSingle( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.ConvertToSingle(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__ConvertToSingleInt32(); + var result = Vector512.ConvertToSingle(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.ConvertToSingle(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.ConvertToSingle(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (float)(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (float)(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.ConvertToSingle)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.UInt32.cs new file mode 100644 index 00000000000000..86c60b45faf31f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.UInt32.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void ConvertToSingleUInt32() + { + var test = new VectorUnaryOpTest__ConvertToSingleUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__ConvertToSingleUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__ConvertToSingleUInt32 testClass) + { + var result = Vector512.ConvertToSingle(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__ConvertToSingleUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__ConvertToSingleUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.ConvertToSingle( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.ConvertToSingle), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.ConvertToSingle), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.ConvertToSingle( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.ConvertToSingle(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__ConvertToSingleUInt32(); + var result = Vector512.ConvertToSingle(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.ConvertToSingle(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.ConvertToSingle(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (float)(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (float)(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.ConvertToSingle)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt32.Single.cs new file mode 100644 index 00000000000000..aa471e04041a36 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt32.Single.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void ConvertToUInt32Single() + { + var test = new VectorUnaryOpTest__ConvertToUInt32Single(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__ConvertToUInt32Single + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__ConvertToUInt32Single testClass) + { + var result = Vector512.ConvertToUInt32(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static Single[] _data1 = new Single[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__ConvertToUInt32Single() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__ConvertToUInt32Single() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.ConvertToUInt32( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.ConvertToUInt32), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.ConvertToUInt32), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.ConvertToUInt32( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.ConvertToUInt32(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__ConvertToUInt32Single(); + var result = Vector512.ConvertToUInt32(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.ConvertToUInt32(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.ConvertToUInt32(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Single[] firstOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.ConvertToUInt32)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt64.Double.cs new file mode 100644 index 00000000000000..15e0f179ef4601 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt64.Double.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void ConvertToUInt64Double() + { + var test = new VectorUnaryOpTest__ConvertToUInt64Double(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__ConvertToUInt64Double + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__ConvertToUInt64Double testClass) + { + var result = Vector512.ConvertToUInt64(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static Double[] _data1 = new Double[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__ConvertToUInt64Double() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__ConvertToUInt64Double() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.ConvertToUInt64( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.ConvertToUInt64), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.ConvertToUInt64), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.ConvertToUInt64( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.ConvertToUInt64(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__ConvertToUInt64Double(); + var result = Vector512.ConvertToUInt64(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.ConvertToUInt64(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.ConvertToUInt64(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Double[] firstOp, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.ConvertToUInt64)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Byte.cs new file mode 100644 index 00000000000000..f1285182b19022 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Byte.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateByte() + { + var test = new VectorCreate__CreateByte(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateByte + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Byte value = TestLibrary.Generator.GetByte(); + Vector512 result = Vector512.Create(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Byte value = TestLibrary.Generator.GetByte(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(Byte) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, Byte expectedValue, [CallerMemberName] string method = "") + { + Byte[] resultElements = new Byte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(Byte[] resultElements, Byte expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != expectedValue) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(Byte): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Double.cs new file mode 100644 index 00000000000000..92a99b3fc599fd --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Double.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateDouble() + { + var test = new VectorCreate__CreateDouble(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateDouble + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Double value = TestLibrary.Generator.GetDouble(); + Vector512 result = Vector512.Create(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Double value = TestLibrary.Generator.GetDouble(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(Double) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, Double expectedValue, [CallerMemberName] string method = "") + { + Double[] resultElements = new Double[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(Double[] resultElements, Double expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != expectedValue) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(Double): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Int16.cs new file mode 100644 index 00000000000000..17889edcc569d5 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Int16.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateInt16() + { + var test = new VectorCreate__CreateInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int16 value = TestLibrary.Generator.GetInt16(); + Vector512 result = Vector512.Create(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Int16 value = TestLibrary.Generator.GetInt16(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(Int16) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, Int16 expectedValue, [CallerMemberName] string method = "") + { + Int16[] resultElements = new Int16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(Int16[] resultElements, Int16 expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != expectedValue) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(Int16): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Int32.cs new file mode 100644 index 00000000000000..2caf7748f3312a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Int32.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateInt32() + { + var test = new VectorCreate__CreateInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int32 value = TestLibrary.Generator.GetInt32(); + Vector512 result = Vector512.Create(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Int32 value = TestLibrary.Generator.GetInt32(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(Int32) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, Int32 expectedValue, [CallerMemberName] string method = "") + { + Int32[] resultElements = new Int32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(Int32[] resultElements, Int32 expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != expectedValue) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(Int32): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Int64.cs new file mode 100644 index 00000000000000..0b1a8ca7e29843 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Int64.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateInt64() + { + var test = new VectorCreate__CreateInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int64 value = TestLibrary.Generator.GetInt64(); + Vector512 result = Vector512.Create(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Int64 value = TestLibrary.Generator.GetInt64(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(Int64) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, Int64 expectedValue, [CallerMemberName] string method = "") + { + Int64[] resultElements = new Int64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(Int64[] resultElements, Int64 expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != expectedValue) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(Int64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.SByte.cs new file mode 100644 index 00000000000000..6f288ff3bdb2df --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.SByte.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateSByte() + { + var test = new VectorCreate__CreateSByte(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateSByte + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + SByte value = TestLibrary.Generator.GetSByte(); + Vector512 result = Vector512.Create(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + SByte value = TestLibrary.Generator.GetSByte(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(SByte) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, SByte expectedValue, [CallerMemberName] string method = "") + { + SByte[] resultElements = new SByte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(SByte[] resultElements, SByte expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != expectedValue) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(SByte): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Single.cs new file mode 100644 index 00000000000000..82a972a0341eb8 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.Single.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateSingle() + { + var test = new VectorCreate__CreateSingle(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateSingle + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Single value = TestLibrary.Generator.GetSingle(); + Vector512 result = Vector512.Create(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Single value = TestLibrary.Generator.GetSingle(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(Single) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, Single expectedValue, [CallerMemberName] string method = "") + { + Single[] resultElements = new Single[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(Single[] resultElements, Single expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != expectedValue) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(Single): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.UInt16.cs new file mode 100644 index 00000000000000..26e908e5ef5fdf --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.UInt16.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateUInt16() + { + var test = new VectorCreate__CreateUInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateUInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt16 value = TestLibrary.Generator.GetUInt16(); + Vector512 result = Vector512.Create(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + UInt16 value = TestLibrary.Generator.GetUInt16(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(UInt16) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, UInt16 expectedValue, [CallerMemberName] string method = "") + { + UInt16[] resultElements = new UInt16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(UInt16[] resultElements, UInt16 expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != expectedValue) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(UInt16): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.UInt32.cs new file mode 100644 index 00000000000000..54aac853d6db3b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.UInt32.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateUInt32() + { + var test = new VectorCreate__CreateUInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateUInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt32 value = TestLibrary.Generator.GetUInt32(); + Vector512 result = Vector512.Create(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + UInt32 value = TestLibrary.Generator.GetUInt32(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(UInt32) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, UInt32 expectedValue, [CallerMemberName] string method = "") + { + UInt32[] resultElements = new UInt32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(UInt32[] resultElements, UInt32 expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != expectedValue) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(UInt32): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.UInt64.cs new file mode 100644 index 00000000000000..5a677e48cf632b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Create.UInt64.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateUInt64() + { + var test = new VectorCreate__CreateUInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateUInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt64 value = TestLibrary.Generator.GetUInt64(); + Vector512 result = Vector512.Create(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + UInt64 value = TestLibrary.Generator.GetUInt64(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(UInt64) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, UInt64 expectedValue, [CallerMemberName] string method = "") + { + UInt64[] resultElements = new UInt64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(UInt64[] resultElements, UInt64 expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != expectedValue) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(UInt64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Byte.cs new file mode 100644 index 00000000000000..91e5339a70b285 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Byte.cs @@ -0,0 +1,114 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateElementByte() + { + var test = new VectorCreate__CreateElementByte(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateElementByte + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Byte[] values = new Byte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetByte(); + } + + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Type[] operandTypes = new Type[ElementCount]; + Byte[] values = new Byte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + operandTypes[i] = typeof(Byte); + values[i] = TestLibrary.Generator.GetByte(); + } + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), operandTypes) + .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31] }); + + ValidateResult((Vector512)(result), values); + } + + private void ValidateResult(Vector512 result, Byte[] expectedValues, [CallerMemberName] string method = "") + { + Byte[] resultElements = new Byte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValues, method); + } + + private void ValidateResult(Byte[] resultElements, Byte[] expectedValues, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != expectedValues[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(Byte): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", expectedValues)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Double.cs new file mode 100644 index 00000000000000..f7c6773b76aaa6 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Double.cs @@ -0,0 +1,114 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateElementDouble() + { + var test = new VectorCreate__CreateElementDouble(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateElementDouble + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Double[] values = new Double[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetDouble(); + } + + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3]); + + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Type[] operandTypes = new Type[ElementCount]; + Double[] values = new Double[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + operandTypes[i] = typeof(Double); + values[i] = TestLibrary.Generator.GetDouble(); + } + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), operandTypes) + .Invoke(null, new object[] { values[0], values[1], values[2], values[3] }); + + ValidateResult((Vector512)(result), values); + } + + private void ValidateResult(Vector512 result, Double[] expectedValues, [CallerMemberName] string method = "") + { + Double[] resultElements = new Double[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValues, method); + } + + private void ValidateResult(Double[] resultElements, Double[] expectedValues, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != expectedValues[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(Double): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", expectedValues)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int16.cs new file mode 100644 index 00000000000000..dcb14180d25c0a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int16.cs @@ -0,0 +1,114 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateElementInt16() + { + var test = new VectorCreate__CreateElementInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateElementInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int16[] values = new Int16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt16(); + } + + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Type[] operandTypes = new Type[ElementCount]; + Int16[] values = new Int16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + operandTypes[i] = typeof(Int16); + values[i] = TestLibrary.Generator.GetInt16(); + } + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), operandTypes) + .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15] }); + + ValidateResult((Vector512)(result), values); + } + + private void ValidateResult(Vector512 result, Int16[] expectedValues, [CallerMemberName] string method = "") + { + Int16[] resultElements = new Int16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValues, method); + } + + private void ValidateResult(Int16[] resultElements, Int16[] expectedValues, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != expectedValues[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(Int16): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", expectedValues)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int32.cs new file mode 100644 index 00000000000000..52d249a724f254 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int32.cs @@ -0,0 +1,114 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateElementInt32() + { + var test = new VectorCreate__CreateElementInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateElementInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int32[] values = new Int32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt32(); + } + + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Type[] operandTypes = new Type[ElementCount]; + Int32[] values = new Int32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + operandTypes[i] = typeof(Int32); + values[i] = TestLibrary.Generator.GetInt32(); + } + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), operandTypes) + .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7] }); + + ValidateResult((Vector512)(result), values); + } + + private void ValidateResult(Vector512 result, Int32[] expectedValues, [CallerMemberName] string method = "") + { + Int32[] resultElements = new Int32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValues, method); + } + + private void ValidateResult(Int32[] resultElements, Int32[] expectedValues, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != expectedValues[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(Int32): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", expectedValues)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int64.cs new file mode 100644 index 00000000000000..7e363332fd8d62 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int64.cs @@ -0,0 +1,114 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateElementInt64() + { + var test = new VectorCreate__CreateElementInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateElementInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int64[] values = new Int64[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt64(); + } + + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3]); + + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Type[] operandTypes = new Type[ElementCount]; + Int64[] values = new Int64[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + operandTypes[i] = typeof(Int64); + values[i] = TestLibrary.Generator.GetInt64(); + } + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), operandTypes) + .Invoke(null, new object[] { values[0], values[1], values[2], values[3] }); + + ValidateResult((Vector512)(result), values); + } + + private void ValidateResult(Vector512 result, Int64[] expectedValues, [CallerMemberName] string method = "") + { + Int64[] resultElements = new Int64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValues, method); + } + + private void ValidateResult(Int64[] resultElements, Int64[] expectedValues, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != expectedValues[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(Int64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", expectedValues)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.SByte.cs new file mode 100644 index 00000000000000..4da78fd46a9777 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.SByte.cs @@ -0,0 +1,114 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateElementSByte() + { + var test = new VectorCreate__CreateElementSByte(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateElementSByte + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + SByte[] values = new SByte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetSByte(); + } + + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Type[] operandTypes = new Type[ElementCount]; + SByte[] values = new SByte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + operandTypes[i] = typeof(SByte); + values[i] = TestLibrary.Generator.GetSByte(); + } + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), operandTypes) + .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31] }); + + ValidateResult((Vector512)(result), values); + } + + private void ValidateResult(Vector512 result, SByte[] expectedValues, [CallerMemberName] string method = "") + { + SByte[] resultElements = new SByte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValues, method); + } + + private void ValidateResult(SByte[] resultElements, SByte[] expectedValues, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != expectedValues[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(SByte): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", expectedValues)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Single.cs new file mode 100644 index 00000000000000..d6173913faa102 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Single.cs @@ -0,0 +1,114 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateElementSingle() + { + var test = new VectorCreate__CreateElementSingle(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateElementSingle + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Single[] values = new Single[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetSingle(); + } + + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Type[] operandTypes = new Type[ElementCount]; + Single[] values = new Single[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + operandTypes[i] = typeof(Single); + values[i] = TestLibrary.Generator.GetSingle(); + } + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), operandTypes) + .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7] }); + + ValidateResult((Vector512)(result), values); + } + + private void ValidateResult(Vector512 result, Single[] expectedValues, [CallerMemberName] string method = "") + { + Single[] resultElements = new Single[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValues, method); + } + + private void ValidateResult(Single[] resultElements, Single[] expectedValues, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != expectedValues[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(Single): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", expectedValues)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt16.cs new file mode 100644 index 00000000000000..2f2061f520a139 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt16.cs @@ -0,0 +1,114 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateElementUInt16() + { + var test = new VectorCreate__CreateElementUInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateElementUInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt16[] values = new UInt16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt16(); + } + + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Type[] operandTypes = new Type[ElementCount]; + UInt16[] values = new UInt16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + operandTypes[i] = typeof(UInt16); + values[i] = TestLibrary.Generator.GetUInt16(); + } + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), operandTypes) + .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15] }); + + ValidateResult((Vector512)(result), values); + } + + private void ValidateResult(Vector512 result, UInt16[] expectedValues, [CallerMemberName] string method = "") + { + UInt16[] resultElements = new UInt16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValues, method); + } + + private void ValidateResult(UInt16[] resultElements, UInt16[] expectedValues, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != expectedValues[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(UInt16): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", expectedValues)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt32.cs new file mode 100644 index 00000000000000..598fc1e9d02244 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt32.cs @@ -0,0 +1,114 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateElementUInt32() + { + var test = new VectorCreate__CreateElementUInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateElementUInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt32[] values = new UInt32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt32(); + } + + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Type[] operandTypes = new Type[ElementCount]; + UInt32[] values = new UInt32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + operandTypes[i] = typeof(UInt32); + values[i] = TestLibrary.Generator.GetUInt32(); + } + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), operandTypes) + .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7] }); + + ValidateResult((Vector512)(result), values); + } + + private void ValidateResult(Vector512 result, UInt32[] expectedValues, [CallerMemberName] string method = "") + { + UInt32[] resultElements = new UInt32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValues, method); + } + + private void ValidateResult(UInt32[] resultElements, UInt32[] expectedValues, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != expectedValues[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(UInt32): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", expectedValues)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt64.cs new file mode 100644 index 00000000000000..89b3a6058c44a8 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt64.cs @@ -0,0 +1,114 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateElementUInt64() + { + var test = new VectorCreate__CreateElementUInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateElementUInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt64[] values = new UInt64[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt64(); + } + + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3]); + + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Type[] operandTypes = new Type[ElementCount]; + UInt64[] values = new UInt64[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + operandTypes[i] = typeof(UInt64); + values[i] = TestLibrary.Generator.GetUInt64(); + } + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), operandTypes) + .Invoke(null, new object[] { values[0], values[1], values[2], values[3] }); + + ValidateResult((Vector512)(result), values); + } + + private void ValidateResult(Vector512 result, UInt64[] expectedValues, [CallerMemberName] string method = "") + { + UInt64[] resultElements = new UInt64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValues, method); + } + + private void ValidateResult(UInt64[] resultElements, UInt64[] expectedValues, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != expectedValues[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(UInt64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", expectedValues)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Byte.cs new file mode 100644 index 00000000000000..cf5ff2b6ce91e7 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Byte.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarByte() + { + var test = new VectorCreate__CreateScalarByte(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarByte + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Byte value = TestLibrary.Generator.GetByte(); + Vector512 result = Vector512.CreateScalar(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Byte value = TestLibrary.Generator.GetByte(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalar), new Type[] { typeof(Byte) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, Byte expectedValue, [CallerMemberName] string method = "") + { + Byte[] resultElements = new Byte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(Byte[] resultElements, Byte expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalar(Byte): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Double.cs new file mode 100644 index 00000000000000..3f84727b35cb01 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Double.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarDouble() + { + var test = new VectorCreate__CreateScalarDouble(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarDouble + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Double value = TestLibrary.Generator.GetDouble(); + Vector512 result = Vector512.CreateScalar(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Double value = TestLibrary.Generator.GetDouble(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalar), new Type[] { typeof(Double) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, Double expectedValue, [CallerMemberName] string method = "") + { + Double[] resultElements = new Double[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(Double[] resultElements, Double expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalar(Double): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Int16.cs new file mode 100644 index 00000000000000..ed5ab6669a499d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Int16.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarInt16() + { + var test = new VectorCreate__CreateScalarInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int16 value = TestLibrary.Generator.GetInt16(); + Vector512 result = Vector512.CreateScalar(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Int16 value = TestLibrary.Generator.GetInt16(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalar), new Type[] { typeof(Int16) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, Int16 expectedValue, [CallerMemberName] string method = "") + { + Int16[] resultElements = new Int16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(Int16[] resultElements, Int16 expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalar(Int16): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Int32.cs new file mode 100644 index 00000000000000..6e3a75194f9674 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Int32.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarInt32() + { + var test = new VectorCreate__CreateScalarInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int32 value = TestLibrary.Generator.GetInt32(); + Vector512 result = Vector512.CreateScalar(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Int32 value = TestLibrary.Generator.GetInt32(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalar), new Type[] { typeof(Int32) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, Int32 expectedValue, [CallerMemberName] string method = "") + { + Int32[] resultElements = new Int32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(Int32[] resultElements, Int32 expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalar(Int32): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Int64.cs new file mode 100644 index 00000000000000..435739c385bd49 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Int64.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarInt64() + { + var test = new VectorCreate__CreateScalarInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int64 value = TestLibrary.Generator.GetInt64(); + Vector512 result = Vector512.CreateScalar(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Int64 value = TestLibrary.Generator.GetInt64(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalar), new Type[] { typeof(Int64) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, Int64 expectedValue, [CallerMemberName] string method = "") + { + Int64[] resultElements = new Int64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(Int64[] resultElements, Int64 expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalar(Int64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.SByte.cs new file mode 100644 index 00000000000000..6e3dfb6430d41d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.SByte.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarSByte() + { + var test = new VectorCreate__CreateScalarSByte(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarSByte + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + SByte value = TestLibrary.Generator.GetSByte(); + Vector512 result = Vector512.CreateScalar(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + SByte value = TestLibrary.Generator.GetSByte(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalar), new Type[] { typeof(SByte) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, SByte expectedValue, [CallerMemberName] string method = "") + { + SByte[] resultElements = new SByte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(SByte[] resultElements, SByte expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalar(SByte): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Single.cs new file mode 100644 index 00000000000000..71dd1761164a7a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.Single.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarSingle() + { + var test = new VectorCreate__CreateScalarSingle(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarSingle + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Single value = TestLibrary.Generator.GetSingle(); + Vector512 result = Vector512.CreateScalar(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Single value = TestLibrary.Generator.GetSingle(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalar), new Type[] { typeof(Single) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, Single expectedValue, [CallerMemberName] string method = "") + { + Single[] resultElements = new Single[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(Single[] resultElements, Single expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalar(Single): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.UInt16.cs new file mode 100644 index 00000000000000..b3a20b09ed22cd --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.UInt16.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarUInt16() + { + var test = new VectorCreate__CreateScalarUInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarUInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt16 value = TestLibrary.Generator.GetUInt16(); + Vector512 result = Vector512.CreateScalar(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + UInt16 value = TestLibrary.Generator.GetUInt16(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalar), new Type[] { typeof(UInt16) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, UInt16 expectedValue, [CallerMemberName] string method = "") + { + UInt16[] resultElements = new UInt16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(UInt16[] resultElements, UInt16 expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalar(UInt16): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.UInt32.cs new file mode 100644 index 00000000000000..f3355516bb1273 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.UInt32.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarUInt32() + { + var test = new VectorCreate__CreateScalarUInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarUInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt32 value = TestLibrary.Generator.GetUInt32(); + Vector512 result = Vector512.CreateScalar(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + UInt32 value = TestLibrary.Generator.GetUInt32(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalar), new Type[] { typeof(UInt32) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, UInt32 expectedValue, [CallerMemberName] string method = "") + { + UInt32[] resultElements = new UInt32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(UInt32[] resultElements, UInt32 expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalar(UInt32): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.UInt64.cs new file mode 100644 index 00000000000000..e0582ea92058e4 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalar.UInt64.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarUInt64() + { + var test = new VectorCreate__CreateScalarUInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarUInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt64 value = TestLibrary.Generator.GetUInt64(); + Vector512 result = Vector512.CreateScalar(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + UInt64 value = TestLibrary.Generator.GetUInt64(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalar), new Type[] { typeof(UInt64) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, UInt64 expectedValue, [CallerMemberName] string method = "") + { + UInt64[] resultElements = new UInt64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(UInt64[] resultElements, UInt64 expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalar(UInt64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Byte.cs new file mode 100644 index 00000000000000..90eabe36a65d87 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Byte.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarUnsafeByte() + { + var test = new VectorCreate__CreateScalarUnsafeByte(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarUnsafeByte + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Byte value = TestLibrary.Generator.GetByte(); + Vector512 result = Vector512.CreateScalarUnsafe(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Byte value = TestLibrary.Generator.GetByte(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalarUnsafe), new Type[] { typeof(Byte) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, Byte expectedValue, [CallerMemberName] string method = "") + { + Byte[] resultElements = new Byte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(Byte[] resultElements, Byte expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (false /* value is uninitialized */) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalarUnsafe(Byte): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Double.cs new file mode 100644 index 00000000000000..3fbb80d0428ed1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Double.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarUnsafeDouble() + { + var test = new VectorCreate__CreateScalarUnsafeDouble(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarUnsafeDouble + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Double value = TestLibrary.Generator.GetDouble(); + Vector512 result = Vector512.CreateScalarUnsafe(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Double value = TestLibrary.Generator.GetDouble(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalarUnsafe), new Type[] { typeof(Double) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, Double expectedValue, [CallerMemberName] string method = "") + { + Double[] resultElements = new Double[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(Double[] resultElements, Double expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (false /* value is uninitialized */) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalarUnsafe(Double): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Int16.cs new file mode 100644 index 00000000000000..6f67f5f2a07090 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Int16.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarUnsafeInt16() + { + var test = new VectorCreate__CreateScalarUnsafeInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarUnsafeInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int16 value = TestLibrary.Generator.GetInt16(); + Vector512 result = Vector512.CreateScalarUnsafe(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Int16 value = TestLibrary.Generator.GetInt16(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalarUnsafe), new Type[] { typeof(Int16) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, Int16 expectedValue, [CallerMemberName] string method = "") + { + Int16[] resultElements = new Int16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(Int16[] resultElements, Int16 expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (false /* value is uninitialized */) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalarUnsafe(Int16): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Int32.cs new file mode 100644 index 00000000000000..3664de35bebc29 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Int32.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarUnsafeInt32() + { + var test = new VectorCreate__CreateScalarUnsafeInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarUnsafeInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int32 value = TestLibrary.Generator.GetInt32(); + Vector512 result = Vector512.CreateScalarUnsafe(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Int32 value = TestLibrary.Generator.GetInt32(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalarUnsafe), new Type[] { typeof(Int32) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, Int32 expectedValue, [CallerMemberName] string method = "") + { + Int32[] resultElements = new Int32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(Int32[] resultElements, Int32 expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (false /* value is uninitialized */) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalarUnsafe(Int32): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Int64.cs new file mode 100644 index 00000000000000..4737830d9fc7d3 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Int64.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarUnsafeInt64() + { + var test = new VectorCreate__CreateScalarUnsafeInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarUnsafeInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int64 value = TestLibrary.Generator.GetInt64(); + Vector512 result = Vector512.CreateScalarUnsafe(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Int64 value = TestLibrary.Generator.GetInt64(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalarUnsafe), new Type[] { typeof(Int64) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, Int64 expectedValue, [CallerMemberName] string method = "") + { + Int64[] resultElements = new Int64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(Int64[] resultElements, Int64 expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (false /* value is uninitialized */) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalarUnsafe(Int64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.SByte.cs new file mode 100644 index 00000000000000..8b994cf1e68a67 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.SByte.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarUnsafeSByte() + { + var test = new VectorCreate__CreateScalarUnsafeSByte(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarUnsafeSByte + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + SByte value = TestLibrary.Generator.GetSByte(); + Vector512 result = Vector512.CreateScalarUnsafe(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + SByte value = TestLibrary.Generator.GetSByte(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalarUnsafe), new Type[] { typeof(SByte) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, SByte expectedValue, [CallerMemberName] string method = "") + { + SByte[] resultElements = new SByte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(SByte[] resultElements, SByte expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (false /* value is uninitialized */) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalarUnsafe(SByte): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Single.cs new file mode 100644 index 00000000000000..6e42409536eb82 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.Single.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarUnsafeSingle() + { + var test = new VectorCreate__CreateScalarUnsafeSingle(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarUnsafeSingle + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Single value = TestLibrary.Generator.GetSingle(); + Vector512 result = Vector512.CreateScalarUnsafe(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Single value = TestLibrary.Generator.GetSingle(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalarUnsafe), new Type[] { typeof(Single) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, Single expectedValue, [CallerMemberName] string method = "") + { + Single[] resultElements = new Single[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(Single[] resultElements, Single expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (false /* value is uninitialized */) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalarUnsafe(Single): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.UInt16.cs new file mode 100644 index 00000000000000..e18b8811edb876 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.UInt16.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarUnsafeUInt16() + { + var test = new VectorCreate__CreateScalarUnsafeUInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarUnsafeUInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt16 value = TestLibrary.Generator.GetUInt16(); + Vector512 result = Vector512.CreateScalarUnsafe(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + UInt16 value = TestLibrary.Generator.GetUInt16(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalarUnsafe), new Type[] { typeof(UInt16) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, UInt16 expectedValue, [CallerMemberName] string method = "") + { + UInt16[] resultElements = new UInt16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(UInt16[] resultElements, UInt16 expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (false /* value is uninitialized */) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalarUnsafe(UInt16): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.UInt32.cs new file mode 100644 index 00000000000000..dab0fd657b6c67 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.UInt32.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarUnsafeUInt32() + { + var test = new VectorCreate__CreateScalarUnsafeUInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarUnsafeUInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt32 value = TestLibrary.Generator.GetUInt32(); + Vector512 result = Vector512.CreateScalarUnsafe(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + UInt32 value = TestLibrary.Generator.GetUInt32(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalarUnsafe), new Type[] { typeof(UInt32) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, UInt32 expectedValue, [CallerMemberName] string method = "") + { + UInt32[] resultElements = new UInt32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(UInt32[] resultElements, UInt32 expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (false /* value is uninitialized */) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalarUnsafe(UInt32): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.UInt64.cs new file mode 100644 index 00000000000000..e1122c55a6ada0 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateScalarUnsafe.UInt64.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateScalarUnsafeUInt64() + { + var test = new VectorCreate__CreateScalarUnsafeUInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateScalarUnsafeUInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt64 value = TestLibrary.Generator.GetUInt64(); + Vector512 result = Vector512.CreateScalarUnsafe(value); + + ValidateResult(result, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + UInt64 value = TestLibrary.Generator.GetUInt64(); + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.CreateScalarUnsafe), new Type[] { typeof(UInt64) }) + .Invoke(null, new object[] { value }); + + ValidateResult((Vector512)(result), value); + } + + private void ValidateResult(Vector512 result, UInt64 expectedValue, [CallerMemberName] string method = "") + { + UInt64[] resultElements = new UInt64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedValue, method); + } + + private void ValidateResult(UInt64[] resultElements, UInt64 expectedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements[0] != expectedValue) + { + succeeded = false; + } + else + { + for (var i = 1; i < ElementCount; i++) + { + if (false /* value is uninitialized */) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.CreateScalarUnsafe(UInt64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: {expectedValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Byte.cs new file mode 100644 index 00000000000000..a527107a31b549 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Byte.cs @@ -0,0 +1,120 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateVectorByte() + { + var test = new VectorCreate__CreateVectorByte(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateVectorByte + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Byte lowerValue = TestLibrary.Generator.GetByte(); + Vector256 lower = Vector256.Create(lowerValue); + + Byte upperValue = TestLibrary.Generator.GetByte(); + Vector256 upper = Vector256.Create(upperValue); + + Vector512 result = Vector512.Create(lower, upper); + + ValidateResult(result, lowerValue, upperValue); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Byte lowerValue = TestLibrary.Generator.GetByte(); + Vector256 lower = Vector256.Create(lowerValue); + + Byte upperValue = TestLibrary.Generator.GetByte(); + Vector256 upper = Vector256.Create(upperValue); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(Vector256), typeof(Vector256) }) + .Invoke(null, new object[] { lower, upper }); + + ValidateResult((Vector512)(result), lowerValue, upperValue); + } + + private void ValidateResult(Vector512 result, Byte expectedLowerValue, Byte expectedUpperValue, [CallerMemberName] string method = "") + { + Byte[] resultElements = new Byte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedLowerValue, expectedUpperValue, method); + } + + private void ValidateResult(Byte[] resultElements, Byte expectedLowerValue, Byte expectedUpperValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount / 2; i++) + { + if (resultElements[i] != expectedLowerValue) + { + succeeded = false; + break; + } + } + + for (var i = ElementCount / 2; i < ElementCount; i++) + { + if (resultElements[i] != expectedUpperValue) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(Byte): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" lower: {expectedLowerValue}"); + TestLibrary.TestFramework.LogInformation($" upper: {expectedUpperValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Double.cs new file mode 100644 index 00000000000000..6b456949e769cc --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Double.cs @@ -0,0 +1,120 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateVectorDouble() + { + var test = new VectorCreate__CreateVectorDouble(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateVectorDouble + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Double lowerValue = TestLibrary.Generator.GetDouble(); + Vector256 lower = Vector256.Create(lowerValue); + + Double upperValue = TestLibrary.Generator.GetDouble(); + Vector256 upper = Vector256.Create(upperValue); + + Vector512 result = Vector512.Create(lower, upper); + + ValidateResult(result, lowerValue, upperValue); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Double lowerValue = TestLibrary.Generator.GetDouble(); + Vector256 lower = Vector256.Create(lowerValue); + + Double upperValue = TestLibrary.Generator.GetDouble(); + Vector256 upper = Vector256.Create(upperValue); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(Vector256), typeof(Vector256) }) + .Invoke(null, new object[] { lower, upper }); + + ValidateResult((Vector512)(result), lowerValue, upperValue); + } + + private void ValidateResult(Vector512 result, Double expectedLowerValue, Double expectedUpperValue, [CallerMemberName] string method = "") + { + Double[] resultElements = new Double[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedLowerValue, expectedUpperValue, method); + } + + private void ValidateResult(Double[] resultElements, Double expectedLowerValue, Double expectedUpperValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount / 2; i++) + { + if (resultElements[i] != expectedLowerValue) + { + succeeded = false; + break; + } + } + + for (var i = ElementCount / 2; i < ElementCount; i++) + { + if (resultElements[i] != expectedUpperValue) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(Double): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" lower: {expectedLowerValue}"); + TestLibrary.TestFramework.LogInformation($" upper: {expectedUpperValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Int16.cs new file mode 100644 index 00000000000000..e3c7eb6ee00795 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Int16.cs @@ -0,0 +1,120 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateVectorInt16() + { + var test = new VectorCreate__CreateVectorInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateVectorInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int16 lowerValue = TestLibrary.Generator.GetInt16(); + Vector256 lower = Vector256.Create(lowerValue); + + Int16 upperValue = TestLibrary.Generator.GetInt16(); + Vector256 upper = Vector256.Create(upperValue); + + Vector512 result = Vector512.Create(lower, upper); + + ValidateResult(result, lowerValue, upperValue); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Int16 lowerValue = TestLibrary.Generator.GetInt16(); + Vector256 lower = Vector256.Create(lowerValue); + + Int16 upperValue = TestLibrary.Generator.GetInt16(); + Vector256 upper = Vector256.Create(upperValue); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(Vector256), typeof(Vector256) }) + .Invoke(null, new object[] { lower, upper }); + + ValidateResult((Vector512)(result), lowerValue, upperValue); + } + + private void ValidateResult(Vector512 result, Int16 expectedLowerValue, Int16 expectedUpperValue, [CallerMemberName] string method = "") + { + Int16[] resultElements = new Int16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedLowerValue, expectedUpperValue, method); + } + + private void ValidateResult(Int16[] resultElements, Int16 expectedLowerValue, Int16 expectedUpperValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount / 2; i++) + { + if (resultElements[i] != expectedLowerValue) + { + succeeded = false; + break; + } + } + + for (var i = ElementCount / 2; i < ElementCount; i++) + { + if (resultElements[i] != expectedUpperValue) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(Int16): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" lower: {expectedLowerValue}"); + TestLibrary.TestFramework.LogInformation($" upper: {expectedUpperValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Int32.cs new file mode 100644 index 00000000000000..a3ee7a4d22efcd --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Int32.cs @@ -0,0 +1,120 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateVectorInt32() + { + var test = new VectorCreate__CreateVectorInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateVectorInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int32 lowerValue = TestLibrary.Generator.GetInt32(); + Vector256 lower = Vector256.Create(lowerValue); + + Int32 upperValue = TestLibrary.Generator.GetInt32(); + Vector256 upper = Vector256.Create(upperValue); + + Vector512 result = Vector512.Create(lower, upper); + + ValidateResult(result, lowerValue, upperValue); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Int32 lowerValue = TestLibrary.Generator.GetInt32(); + Vector256 lower = Vector256.Create(lowerValue); + + Int32 upperValue = TestLibrary.Generator.GetInt32(); + Vector256 upper = Vector256.Create(upperValue); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(Vector256), typeof(Vector256) }) + .Invoke(null, new object[] { lower, upper }); + + ValidateResult((Vector512)(result), lowerValue, upperValue); + } + + private void ValidateResult(Vector512 result, Int32 expectedLowerValue, Int32 expectedUpperValue, [CallerMemberName] string method = "") + { + Int32[] resultElements = new Int32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedLowerValue, expectedUpperValue, method); + } + + private void ValidateResult(Int32[] resultElements, Int32 expectedLowerValue, Int32 expectedUpperValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount / 2; i++) + { + if (resultElements[i] != expectedLowerValue) + { + succeeded = false; + break; + } + } + + for (var i = ElementCount / 2; i < ElementCount; i++) + { + if (resultElements[i] != expectedUpperValue) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(Int32): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" lower: {expectedLowerValue}"); + TestLibrary.TestFramework.LogInformation($" upper: {expectedUpperValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Int64.cs new file mode 100644 index 00000000000000..4f039247585ff3 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Int64.cs @@ -0,0 +1,120 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateVectorInt64() + { + var test = new VectorCreate__CreateVectorInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateVectorInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int64 lowerValue = TestLibrary.Generator.GetInt64(); + Vector256 lower = Vector256.Create(lowerValue); + + Int64 upperValue = TestLibrary.Generator.GetInt64(); + Vector256 upper = Vector256.Create(upperValue); + + Vector512 result = Vector512.Create(lower, upper); + + ValidateResult(result, lowerValue, upperValue); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Int64 lowerValue = TestLibrary.Generator.GetInt64(); + Vector256 lower = Vector256.Create(lowerValue); + + Int64 upperValue = TestLibrary.Generator.GetInt64(); + Vector256 upper = Vector256.Create(upperValue); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(Vector256), typeof(Vector256) }) + .Invoke(null, new object[] { lower, upper }); + + ValidateResult((Vector512)(result), lowerValue, upperValue); + } + + private void ValidateResult(Vector512 result, Int64 expectedLowerValue, Int64 expectedUpperValue, [CallerMemberName] string method = "") + { + Int64[] resultElements = new Int64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedLowerValue, expectedUpperValue, method); + } + + private void ValidateResult(Int64[] resultElements, Int64 expectedLowerValue, Int64 expectedUpperValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount / 2; i++) + { + if (resultElements[i] != expectedLowerValue) + { + succeeded = false; + break; + } + } + + for (var i = ElementCount / 2; i < ElementCount; i++) + { + if (resultElements[i] != expectedUpperValue) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(Int64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" lower: {expectedLowerValue}"); + TestLibrary.TestFramework.LogInformation($" upper: {expectedUpperValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.SByte.cs new file mode 100644 index 00000000000000..2ee155eab83011 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.SByte.cs @@ -0,0 +1,120 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateVectorSByte() + { + var test = new VectorCreate__CreateVectorSByte(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateVectorSByte + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + SByte lowerValue = TestLibrary.Generator.GetSByte(); + Vector256 lower = Vector256.Create(lowerValue); + + SByte upperValue = TestLibrary.Generator.GetSByte(); + Vector256 upper = Vector256.Create(upperValue); + + Vector512 result = Vector512.Create(lower, upper); + + ValidateResult(result, lowerValue, upperValue); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + SByte lowerValue = TestLibrary.Generator.GetSByte(); + Vector256 lower = Vector256.Create(lowerValue); + + SByte upperValue = TestLibrary.Generator.GetSByte(); + Vector256 upper = Vector256.Create(upperValue); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(Vector256), typeof(Vector256) }) + .Invoke(null, new object[] { lower, upper }); + + ValidateResult((Vector512)(result), lowerValue, upperValue); + } + + private void ValidateResult(Vector512 result, SByte expectedLowerValue, SByte expectedUpperValue, [CallerMemberName] string method = "") + { + SByte[] resultElements = new SByte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedLowerValue, expectedUpperValue, method); + } + + private void ValidateResult(SByte[] resultElements, SByte expectedLowerValue, SByte expectedUpperValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount / 2; i++) + { + if (resultElements[i] != expectedLowerValue) + { + succeeded = false; + break; + } + } + + for (var i = ElementCount / 2; i < ElementCount; i++) + { + if (resultElements[i] != expectedUpperValue) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(SByte): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" lower: {expectedLowerValue}"); + TestLibrary.TestFramework.LogInformation($" upper: {expectedUpperValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Single.cs new file mode 100644 index 00000000000000..b5cf1757d96c19 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.Single.cs @@ -0,0 +1,120 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateVectorSingle() + { + var test = new VectorCreate__CreateVectorSingle(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateVectorSingle + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Single lowerValue = TestLibrary.Generator.GetSingle(); + Vector256 lower = Vector256.Create(lowerValue); + + Single upperValue = TestLibrary.Generator.GetSingle(); + Vector256 upper = Vector256.Create(upperValue); + + Vector512 result = Vector512.Create(lower, upper); + + ValidateResult(result, lowerValue, upperValue); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Single lowerValue = TestLibrary.Generator.GetSingle(); + Vector256 lower = Vector256.Create(lowerValue); + + Single upperValue = TestLibrary.Generator.GetSingle(); + Vector256 upper = Vector256.Create(upperValue); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(Vector256), typeof(Vector256) }) + .Invoke(null, new object[] { lower, upper }); + + ValidateResult((Vector512)(result), lowerValue, upperValue); + } + + private void ValidateResult(Vector512 result, Single expectedLowerValue, Single expectedUpperValue, [CallerMemberName] string method = "") + { + Single[] resultElements = new Single[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedLowerValue, expectedUpperValue, method); + } + + private void ValidateResult(Single[] resultElements, Single expectedLowerValue, Single expectedUpperValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount / 2; i++) + { + if (resultElements[i] != expectedLowerValue) + { + succeeded = false; + break; + } + } + + for (var i = ElementCount / 2; i < ElementCount; i++) + { + if (resultElements[i] != expectedUpperValue) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(Single): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" lower: {expectedLowerValue}"); + TestLibrary.TestFramework.LogInformation($" upper: {expectedUpperValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.UInt16.cs new file mode 100644 index 00000000000000..21681995ad9725 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.UInt16.cs @@ -0,0 +1,120 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateVectorUInt16() + { + var test = new VectorCreate__CreateVectorUInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateVectorUInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt16 lowerValue = TestLibrary.Generator.GetUInt16(); + Vector256 lower = Vector256.Create(lowerValue); + + UInt16 upperValue = TestLibrary.Generator.GetUInt16(); + Vector256 upper = Vector256.Create(upperValue); + + Vector512 result = Vector512.Create(lower, upper); + + ValidateResult(result, lowerValue, upperValue); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + UInt16 lowerValue = TestLibrary.Generator.GetUInt16(); + Vector256 lower = Vector256.Create(lowerValue); + + UInt16 upperValue = TestLibrary.Generator.GetUInt16(); + Vector256 upper = Vector256.Create(upperValue); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(Vector256), typeof(Vector256) }) + .Invoke(null, new object[] { lower, upper }); + + ValidateResult((Vector512)(result), lowerValue, upperValue); + } + + private void ValidateResult(Vector512 result, UInt16 expectedLowerValue, UInt16 expectedUpperValue, [CallerMemberName] string method = "") + { + UInt16[] resultElements = new UInt16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedLowerValue, expectedUpperValue, method); + } + + private void ValidateResult(UInt16[] resultElements, UInt16 expectedLowerValue, UInt16 expectedUpperValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount / 2; i++) + { + if (resultElements[i] != expectedLowerValue) + { + succeeded = false; + break; + } + } + + for (var i = ElementCount / 2; i < ElementCount; i++) + { + if (resultElements[i] != expectedUpperValue) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(UInt16): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" lower: {expectedLowerValue}"); + TestLibrary.TestFramework.LogInformation($" upper: {expectedUpperValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.UInt32.cs new file mode 100644 index 00000000000000..69f5f3b4ad225f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.UInt32.cs @@ -0,0 +1,120 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateVectorUInt32() + { + var test = new VectorCreate__CreateVectorUInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateVectorUInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt32 lowerValue = TestLibrary.Generator.GetUInt32(); + Vector256 lower = Vector256.Create(lowerValue); + + UInt32 upperValue = TestLibrary.Generator.GetUInt32(); + Vector256 upper = Vector256.Create(upperValue); + + Vector512 result = Vector512.Create(lower, upper); + + ValidateResult(result, lowerValue, upperValue); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + UInt32 lowerValue = TestLibrary.Generator.GetUInt32(); + Vector256 lower = Vector256.Create(lowerValue); + + UInt32 upperValue = TestLibrary.Generator.GetUInt32(); + Vector256 upper = Vector256.Create(upperValue); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(Vector256), typeof(Vector256) }) + .Invoke(null, new object[] { lower, upper }); + + ValidateResult((Vector512)(result), lowerValue, upperValue); + } + + private void ValidateResult(Vector512 result, UInt32 expectedLowerValue, UInt32 expectedUpperValue, [CallerMemberName] string method = "") + { + UInt32[] resultElements = new UInt32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedLowerValue, expectedUpperValue, method); + } + + private void ValidateResult(UInt32[] resultElements, UInt32 expectedLowerValue, UInt32 expectedUpperValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount / 2; i++) + { + if (resultElements[i] != expectedLowerValue) + { + succeeded = false; + break; + } + } + + for (var i = ElementCount / 2; i < ElementCount; i++) + { + if (resultElements[i] != expectedUpperValue) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(UInt32): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" lower: {expectedLowerValue}"); + TestLibrary.TestFramework.LogInformation($" upper: {expectedUpperValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.UInt64.cs new file mode 100644 index 00000000000000..4478e4276b130f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateVector.UInt64.cs @@ -0,0 +1,120 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void CreateVectorUInt64() + { + var test = new VectorCreate__CreateVectorUInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorCreate__CreateVectorUInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt64 lowerValue = TestLibrary.Generator.GetUInt64(); + Vector256 lower = Vector256.Create(lowerValue); + + UInt64 upperValue = TestLibrary.Generator.GetUInt64(); + Vector256 upper = Vector256.Create(upperValue); + + Vector512 result = Vector512.Create(lower, upper); + + ValidateResult(result, lowerValue, upperValue); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + UInt64 lowerValue = TestLibrary.Generator.GetUInt64(); + Vector256 lower = Vector256.Create(lowerValue); + + UInt64 upperValue = TestLibrary.Generator.GetUInt64(); + Vector256 upper = Vector256.Create(upperValue); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.Create), new Type[] { typeof(Vector256), typeof(Vector256) }) + .Invoke(null, new object[] { lower, upper }); + + ValidateResult((Vector512)(result), lowerValue, upperValue); + } + + private void ValidateResult(Vector512 result, UInt64 expectedLowerValue, UInt64 expectedUpperValue, [CallerMemberName] string method = "") + { + UInt64[] resultElements = new UInt64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, expectedLowerValue, expectedUpperValue, method); + } + + private void ValidateResult(UInt64[] resultElements, UInt64 expectedLowerValue, UInt64 expectedUpperValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount / 2; i++) + { + if (resultElements[i] != expectedLowerValue) + { + succeeded = false; + break; + } + } + + for (var i = ElementCount / 2; i < ElementCount; i++) + { + if (resultElements[i] != expectedUpperValue) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Create(UInt64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" lower: {expectedLowerValue}"); + TestLibrary.TestFramework.LogInformation($" upper: {expectedUpperValue}"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Byte.cs new file mode 100644 index 00000000000000..99e0fde1f9dc41 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Byte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DivideByte() + { + var test = new VectorBinaryOpTest__DivideByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DivideByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((byte)(1), TestLibrary.Generator.GetByte()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DivideByte testClass) + { + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DivideByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((byte)(1), TestLibrary.Generator.GetByte()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DivideByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((byte)(1), TestLibrary.Generator.GetByte()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((byte)(1), TestLibrary.Generator.GetByte()); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Divide( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Divide( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Divide(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DivideByte(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Divide)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Double.cs new file mode 100644 index 00000000000000..3ab5eeda8a6fb2 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Double.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DivideDouble() + { + var test = new VectorBinaryOpTest__DivideDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DivideDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((double)(1), TestLibrary.Generator.GetDouble()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DivideDouble testClass) + { + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DivideDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((double)(1), TestLibrary.Generator.GetDouble()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DivideDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((double)(1), TestLibrary.Generator.GetDouble()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((double)(1), TestLibrary.Generator.GetDouble()); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Divide( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Divide( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Divide(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DivideDouble(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (double)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (double)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Divide)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int16.cs new file mode 100644 index 00000000000000..aee5ba12074075 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DivideInt16() + { + var test = new VectorBinaryOpTest__DivideInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DivideInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((short)(1), TestLibrary.Generator.GetInt16()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DivideInt16 testClass) + { + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DivideInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((short)(1), TestLibrary.Generator.GetInt16()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DivideInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((short)(1), TestLibrary.Generator.GetInt16()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((short)(1), TestLibrary.Generator.GetInt16()); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Divide( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Divide( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Divide(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DivideInt16(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Divide)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int32.cs new file mode 100644 index 00000000000000..1d98a32bf6745c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DivideInt32() + { + var test = new VectorBinaryOpTest__DivideInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DivideInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((int)(1), TestLibrary.Generator.GetInt32()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DivideInt32 testClass) + { + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DivideInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((int)(1), TestLibrary.Generator.GetInt32()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DivideInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((int)(1), TestLibrary.Generator.GetInt32()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((int)(1), TestLibrary.Generator.GetInt32()); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Divide( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Divide( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Divide(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DivideInt32(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Divide)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int64.cs new file mode 100644 index 00000000000000..58fd1908678d2c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DivideInt64() + { + var test = new VectorBinaryOpTest__DivideInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DivideInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((long)(1), TestLibrary.Generator.GetInt64()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DivideInt64 testClass) + { + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DivideInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((long)(1), TestLibrary.Generator.GetInt64()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DivideInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((long)(1), TestLibrary.Generator.GetInt64()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((long)(1), TestLibrary.Generator.GetInt64()); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Divide( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Divide( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Divide(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DivideInt64(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Divide)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.SByte.cs new file mode 100644 index 00000000000000..47ff02908c0197 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.SByte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DivideSByte() + { + var test = new VectorBinaryOpTest__DivideSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DivideSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((sbyte)(1), TestLibrary.Generator.GetSByte()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DivideSByte testClass) + { + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DivideSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((sbyte)(1), TestLibrary.Generator.GetSByte()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DivideSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((sbyte)(1), TestLibrary.Generator.GetSByte()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((sbyte)(1), TestLibrary.Generator.GetSByte()); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Divide( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Divide( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Divide(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DivideSByte(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Divide)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Single.cs new file mode 100644 index 00000000000000..6c267e8421e40a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Single.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DivideSingle() + { + var test = new VectorBinaryOpTest__DivideSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DivideSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((float)(1), TestLibrary.Generator.GetSingle()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DivideSingle testClass) + { + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DivideSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((float)(1), TestLibrary.Generator.GetSingle()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DivideSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((float)(1), TestLibrary.Generator.GetSingle()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((float)(1), TestLibrary.Generator.GetSingle()); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Divide( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Divide( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Divide(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DivideSingle(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (float)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (float)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Divide)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt16.cs new file mode 100644 index 00000000000000..8bb0d59ee89629 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DivideUInt16() + { + var test = new VectorBinaryOpTest__DivideUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DivideUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((ushort)(1), TestLibrary.Generator.GetUInt16()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DivideUInt16 testClass) + { + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DivideUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((ushort)(1), TestLibrary.Generator.GetUInt16()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DivideUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((ushort)(1), TestLibrary.Generator.GetUInt16()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((ushort)(1), TestLibrary.Generator.GetUInt16()); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Divide( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Divide( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Divide(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DivideUInt16(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Divide)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt32.cs new file mode 100644 index 00000000000000..49ea387820d702 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DivideUInt32() + { + var test = new VectorBinaryOpTest__DivideUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DivideUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((uint)(1), TestLibrary.Generator.GetUInt32()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DivideUInt32 testClass) + { + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DivideUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((uint)(1), TestLibrary.Generator.GetUInt32()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DivideUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((uint)(1), TestLibrary.Generator.GetUInt32()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((uint)(1), TestLibrary.Generator.GetUInt32()); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Divide( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Divide( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Divide(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DivideUInt32(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Divide)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt64.cs new file mode 100644 index 00000000000000..f6ee5a775a615d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DivideUInt64() + { + var test = new VectorBinaryOpTest__DivideUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DivideUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((ulong)(1), TestLibrary.Generator.GetUInt64()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DivideUInt64 testClass) + { + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DivideUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((ulong)(1), TestLibrary.Generator.GetUInt64()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DivideUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((ulong)(1), TestLibrary.Generator.GetUInt64()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((ulong)(1), TestLibrary.Generator.GetUInt64()); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Divide( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Divide), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Divide( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Divide(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DivideUInt64(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Divide(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Divide(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Divide)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs new file mode 100644 index 00000000000000..780f2aca720e19 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs @@ -0,0 +1,328 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DotByte() + { + var test = new VectorBinaryOpTest__DotByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DotByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DotByte testClass) + { + var result = Vector512.Dot(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DotByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DotByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Dot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (Byte)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Dot( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Dot(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DotByte(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Dot(_fld1, _fld2); + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, Byte result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, Byte result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + Byte actualResult = default; + Byte intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Byte)(left[i] * right[i]); + } + + actualResult += intermResult; + + if (actualResult != result) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Dot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs new file mode 100644 index 00000000000000..33fe6fe0831a74 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs @@ -0,0 +1,328 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DotDouble() + { + var test = new VectorBinaryOpTest__DotDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DotDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DotDouble testClass) + { + var result = Vector512.Dot(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DotDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DotDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Dot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (Double)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Dot( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Dot(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DotDouble(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Dot(_fld1, _fld2); + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, Double result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, Double result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + Double actualResult = default; + Double intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Double)(left[i] * right[i]); + } + + actualResult += intermResult; + + if (actualResult != result) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Dot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs new file mode 100644 index 00000000000000..5cb8b452a399b2 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs @@ -0,0 +1,328 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DotInt16() + { + var test = new VectorBinaryOpTest__DotInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DotInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DotInt16 testClass) + { + var result = Vector512.Dot(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DotInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DotInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Dot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (Int16)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Dot( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Dot(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DotInt16(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Dot(_fld1, _fld2); + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, Int16 result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, Int16 result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + Int16 actualResult = default; + Int16 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Int16)(left[i] * right[i]); + } + + actualResult += intermResult; + + if (actualResult != result) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Dot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs new file mode 100644 index 00000000000000..200375b8179a6d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs @@ -0,0 +1,328 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DotInt32() + { + var test = new VectorBinaryOpTest__DotInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DotInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DotInt32 testClass) + { + var result = Vector512.Dot(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DotInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DotInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Dot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (Int32)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Dot( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Dot(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DotInt32(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Dot(_fld1, _fld2); + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, Int32 result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, Int32 result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + Int32 actualResult = default; + Int32 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Int32)(left[i] * right[i]); + } + + actualResult += intermResult; + + if (actualResult != result) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Dot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs new file mode 100644 index 00000000000000..647ef036158613 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs @@ -0,0 +1,328 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DotInt64() + { + var test = new VectorBinaryOpTest__DotInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DotInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DotInt64 testClass) + { + var result = Vector512.Dot(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DotInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DotInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Dot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (Int64)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Dot( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Dot(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DotInt64(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Dot(_fld1, _fld2); + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, Int64 result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, Int64 result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + Int64 actualResult = default; + Int64 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Int64)(left[i] * right[i]); + } + + actualResult += intermResult; + + if (actualResult != result) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Dot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs new file mode 100644 index 00000000000000..74375de6994334 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs @@ -0,0 +1,328 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DotSByte() + { + var test = new VectorBinaryOpTest__DotSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DotSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DotSByte testClass) + { + var result = Vector512.Dot(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DotSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DotSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Dot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (SByte)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Dot( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Dot(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DotSByte(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Dot(_fld1, _fld2); + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, SByte result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, SByte result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + SByte actualResult = default; + SByte intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (SByte)(left[i] * right[i]); + } + + actualResult += intermResult; + + if (actualResult != result) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Dot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs new file mode 100644 index 00000000000000..0dfb8e63a09450 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs @@ -0,0 +1,328 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DotSingle() + { + var test = new VectorBinaryOpTest__DotSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DotSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DotSingle testClass) + { + var result = Vector512.Dot(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DotSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DotSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Dot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (Single)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Dot( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Dot(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DotSingle(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Dot(_fld1, _fld2); + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, Single result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, Single result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + Single actualResult = default; + Single intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Single)(left[i] * right[i]); + } + + actualResult += intermResult; + + if (actualResult != result) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Dot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs new file mode 100644 index 00000000000000..b367966aa846c3 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs @@ -0,0 +1,328 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DotUInt16() + { + var test = new VectorBinaryOpTest__DotUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DotUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DotUInt16 testClass) + { + var result = Vector512.Dot(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DotUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DotUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Dot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (UInt16)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Dot( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Dot(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DotUInt16(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Dot(_fld1, _fld2); + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, UInt16 result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, UInt16 result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + UInt16 actualResult = default; + UInt16 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (UInt16)(left[i] * right[i]); + } + + actualResult += intermResult; + + if (actualResult != result) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Dot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs new file mode 100644 index 00000000000000..46bdff5a29329e --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs @@ -0,0 +1,328 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DotUInt32() + { + var test = new VectorBinaryOpTest__DotUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DotUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DotUInt32 testClass) + { + var result = Vector512.Dot(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DotUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DotUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Dot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (UInt32)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Dot( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Dot(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DotUInt32(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Dot(_fld1, _fld2); + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, UInt32 result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, UInt32 result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + UInt32 actualResult = default; + UInt32 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (UInt32)(left[i] * right[i]); + } + + actualResult += intermResult; + + if (actualResult != result) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Dot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs new file mode 100644 index 00000000000000..7bc9f1c1162ea7 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs @@ -0,0 +1,328 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void DotUInt64() + { + var test = new VectorBinaryOpTest__DotUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__DotUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__DotUInt64 testClass) + { + var result = Vector512.Dot(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__DotUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__DotUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Dot( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Dot), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (UInt64)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Dot( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Dot(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__DotUInt64(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Dot(_fld1, _fld2); + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Dot(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, UInt64 result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, UInt64 result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + UInt64 actualResult = default; + UInt64 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (UInt64)(left[i] * right[i]); + } + + actualResult += intermResult; + + if (actualResult != result) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Dot)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Byte.cs new file mode 100644 index 00000000000000..84f38dd716bf10 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Byte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsByte() + { + var test = new VectorBinaryOpTest__EqualsByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__EqualsByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__EqualsByte testClass) + { + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__EqualsByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__EqualsByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Equals( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Equals( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Equals(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__EqualsByte(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] == right[0]) ? byte.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] == right[i]) ? byte.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Equals)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Double.cs new file mode 100644 index 00000000000000..28cfddbfaa3dfc --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Double.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsDouble() + { + var test = new VectorBinaryOpTest__EqualsDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__EqualsDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__EqualsDouble testClass) + { + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__EqualsDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__EqualsDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Equals( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Equals( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Equals(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__EqualsDouble(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.DoubleToInt64Bits(result[0]) != ((left[0] == right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(result[i]) != ((left[i] == right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Equals)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int16.cs new file mode 100644 index 00000000000000..e1be74348f2b64 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsInt16() + { + var test = new VectorBinaryOpTest__EqualsInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__EqualsInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__EqualsInt16 testClass) + { + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__EqualsInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__EqualsInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Equals( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Equals( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Equals(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__EqualsInt16(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] == right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] == right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Equals)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int32.cs new file mode 100644 index 00000000000000..a519f1d6fafc97 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsInt32() + { + var test = new VectorBinaryOpTest__EqualsInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__EqualsInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__EqualsInt32 testClass) + { + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__EqualsInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__EqualsInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Equals( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Equals( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Equals(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__EqualsInt32(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] == right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] == right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Equals)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int64.cs new file mode 100644 index 00000000000000..986e9340f25654 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsInt64() + { + var test = new VectorBinaryOpTest__EqualsInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__EqualsInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__EqualsInt64 testClass) + { + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__EqualsInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__EqualsInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Equals( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Equals( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Equals(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__EqualsInt64(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] == right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] == right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Equals)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.SByte.cs new file mode 100644 index 00000000000000..202ab1367dc64a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.SByte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsSByte() + { + var test = new VectorBinaryOpTest__EqualsSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__EqualsSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__EqualsSByte testClass) + { + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__EqualsSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__EqualsSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Equals( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Equals( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Equals(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__EqualsSByte(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] == right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] == right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Equals)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Single.cs new file mode 100644 index 00000000000000..5d9b519bdb8782 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Single.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsSingle() + { + var test = new VectorBinaryOpTest__EqualsSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__EqualsSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__EqualsSingle testClass) + { + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__EqualsSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__EqualsSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Equals( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Equals( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Equals(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__EqualsSingle(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.SingleToInt32Bits(result[0]) != ((left[0] == right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(result[i]) != ((left[i] == right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Equals)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt16.cs new file mode 100644 index 00000000000000..09349aa5f4f3ee --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsUInt16() + { + var test = new VectorBinaryOpTest__EqualsUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__EqualsUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__EqualsUInt16 testClass) + { + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__EqualsUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__EqualsUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Equals( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Equals( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Equals(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__EqualsUInt16(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] == right[0]) ? ushort.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] == right[i]) ? ushort.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Equals)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt32.cs new file mode 100644 index 00000000000000..88fcdb206f3541 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsUInt32() + { + var test = new VectorBinaryOpTest__EqualsUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__EqualsUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__EqualsUInt32 testClass) + { + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__EqualsUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__EqualsUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Equals( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Equals( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Equals(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__EqualsUInt32(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] == right[0]) ? uint.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] == right[i]) ? uint.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Equals)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt64.cs new file mode 100644 index 00000000000000..3d3613c38e4d3b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsUInt64() + { + var test = new VectorBinaryOpTest__EqualsUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__EqualsUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__EqualsUInt64 testClass) + { + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__EqualsUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__EqualsUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Equals( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Equals), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Equals( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Equals(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__EqualsUInt64(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Equals(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Equals(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] == right[0]) ? ulong.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] == right[i]) ? ulong.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Equals)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Byte.cs new file mode 100644 index 00000000000000..f1d251f3418851 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Byte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAllByte() + { + var test = new VectorBooleanBinaryOpTest__EqualsAllByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAllByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAllByte testClass) + { + var result = Vector512.EqualsAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAllByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAllByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAllByte(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Double.cs new file mode 100644 index 00000000000000..81272785952c6b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Double.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAllDouble() + { + var test = new VectorBooleanBinaryOpTest__EqualsAllDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAllDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAllDouble testClass) + { + var result = Vector512.EqualsAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAllDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAllDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAllDouble(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Double[] left, Double[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int16.cs new file mode 100644 index 00000000000000..a3343a20f46f31 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAllInt16() + { + var test = new VectorBooleanBinaryOpTest__EqualsAllInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAllInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAllInt16 testClass) + { + var result = Vector512.EqualsAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAllInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAllInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAllInt16(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int32.cs new file mode 100644 index 00000000000000..dc6332e73e8763 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAllInt32() + { + var test = new VectorBooleanBinaryOpTest__EqualsAllInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAllInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAllInt32 testClass) + { + var result = Vector512.EqualsAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAllInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAllInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAllInt32(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int64.cs new file mode 100644 index 00000000000000..20990dfbc8c3fe --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAllInt64() + { + var test = new VectorBooleanBinaryOpTest__EqualsAllInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAllInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAllInt64 testClass) + { + var result = Vector512.EqualsAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAllInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAllInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAllInt64(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.SByte.cs new file mode 100644 index 00000000000000..85ed136d212af3 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.SByte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAllSByte() + { + var test = new VectorBooleanBinaryOpTest__EqualsAllSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAllSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAllSByte testClass) + { + var result = Vector512.EqualsAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAllSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAllSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAllSByte(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Single.cs new file mode 100644 index 00000000000000..3d723beb7b0491 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Single.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAllSingle() + { + var test = new VectorBooleanBinaryOpTest__EqualsAllSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAllSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAllSingle testClass) + { + var result = Vector512.EqualsAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAllSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAllSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAllSingle(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Single[] left, Single[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt16.cs new file mode 100644 index 00000000000000..cd86ba34ceb664 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAllUInt16() + { + var test = new VectorBooleanBinaryOpTest__EqualsAllUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAllUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAllUInt16 testClass) + { + var result = Vector512.EqualsAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAllUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAllUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAllUInt16(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt32.cs new file mode 100644 index 00000000000000..a0bd2ccc4dcce8 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAllUInt32() + { + var test = new VectorBooleanBinaryOpTest__EqualsAllUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAllUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAllUInt32 testClass) + { + var result = Vector512.EqualsAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAllUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAllUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAllUInt32(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt64.cs new file mode 100644 index 00000000000000..388b41626b80a6 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAllUInt64() + { + var test = new VectorBooleanBinaryOpTest__EqualsAllUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAllUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAllUInt64 testClass) + { + var result = Vector512.EqualsAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAllUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAllUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAllUInt64(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Byte.cs new file mode 100644 index 00000000000000..2092ed4e96bb5d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Byte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAnyByte() + { + var test = new VectorBooleanBinaryOpTest__EqualsAnyByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAnyByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAnyByte testClass) + { + var result = Vector512.EqualsAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAnyByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAnyByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAnyByte(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Double.cs new file mode 100644 index 00000000000000..a3279f51cf2ff9 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Double.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAnyDouble() + { + var test = new VectorBooleanBinaryOpTest__EqualsAnyDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAnyDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAnyDouble testClass) + { + var result = Vector512.EqualsAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAnyDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAnyDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAnyDouble(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Double[] left, Double[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int16.cs new file mode 100644 index 00000000000000..b96fa1d081f8d5 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAnyInt16() + { + var test = new VectorBooleanBinaryOpTest__EqualsAnyInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAnyInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAnyInt16 testClass) + { + var result = Vector512.EqualsAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAnyInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAnyInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAnyInt16(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int32.cs new file mode 100644 index 00000000000000..987405fb0a8a6a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAnyInt32() + { + var test = new VectorBooleanBinaryOpTest__EqualsAnyInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAnyInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAnyInt32 testClass) + { + var result = Vector512.EqualsAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAnyInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAnyInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAnyInt32(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int64.cs new file mode 100644 index 00000000000000..a474aafbbb480a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAnyInt64() + { + var test = new VectorBooleanBinaryOpTest__EqualsAnyInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAnyInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAnyInt64 testClass) + { + var result = Vector512.EqualsAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAnyInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAnyInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAnyInt64(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.SByte.cs new file mode 100644 index 00000000000000..de3e1d1ad0d253 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.SByte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAnySByte() + { + var test = new VectorBooleanBinaryOpTest__EqualsAnySByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAnySByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAnySByte testClass) + { + var result = Vector512.EqualsAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAnySByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAnySByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAnySByte(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Single.cs new file mode 100644 index 00000000000000..94b83fdb92cf4b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Single.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAnySingle() + { + var test = new VectorBooleanBinaryOpTest__EqualsAnySingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAnySingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAnySingle testClass) + { + var result = Vector512.EqualsAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAnySingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAnySingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAnySingle(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Single[] left, Single[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt16.cs new file mode 100644 index 00000000000000..ccf7dc4e92f449 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAnyUInt16() + { + var test = new VectorBooleanBinaryOpTest__EqualsAnyUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAnyUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAnyUInt16 testClass) + { + var result = Vector512.EqualsAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAnyUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAnyUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAnyUInt16(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt32.cs new file mode 100644 index 00000000000000..a4b9cf53478635 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAnyUInt32() + { + var test = new VectorBooleanBinaryOpTest__EqualsAnyUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAnyUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAnyUInt32 testClass) + { + var result = Vector512.EqualsAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAnyUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAnyUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAnyUInt32(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt64.cs new file mode 100644 index 00000000000000..e55d62932f1538 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void EqualsAnyUInt64() + { + var test = new VectorBooleanBinaryOpTest__EqualsAnyUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__EqualsAnyUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__EqualsAnyUInt64 testClass) + { + var result = Vector512.EqualsAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__EqualsAnyUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__EqualsAnyUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.EqualsAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.EqualsAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.EqualsAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.EqualsAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__EqualsAnyUInt64(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.EqualsAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.EqualsAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.EqualsAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Double.cs new file mode 100644 index 00000000000000..c2ff7b80008c39 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Double.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void FloorDouble() + { + var test = new VectorUnaryOpTest__FloorDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__FloorDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__FloorDouble testClass) + { + var result = Vector512.Floor(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__FloorDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__FloorDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Floor( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Floor), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Floor), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Floor( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Floor(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__FloorDouble(); + var result = Vector512.Floor(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Floor(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Floor(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != Math.Floor(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != Math.Floor(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Floor)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Single.cs new file mode 100644 index 00000000000000..dfca9ee8ab9271 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Single.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void FloorSingle() + { + var test = new VectorUnaryOpTest__FloorSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__FloorSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__FloorSingle testClass) + { + var result = Vector512.Floor(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__FloorSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__FloorSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Floor( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Floor), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Floor), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Floor( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Floor(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__FloorSingle(); + var result = Vector512.Floor(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Floor(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Floor(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != MathF.Floor(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != MathF.Floor(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Floor)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Byte.cs new file mode 100644 index 00000000000000..25f5b97f2b51d7 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Byte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanByte() + { + var test = new VectorBinaryOpTest__GreaterThanByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanByte testClass) + { + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanByte(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] > right[0]) ? byte.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] > right[i]) ? byte.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Double.cs new file mode 100644 index 00000000000000..3209e2e9129012 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Double.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanDouble() + { + var test = new VectorBinaryOpTest__GreaterThanDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanDouble testClass) + { + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanDouble(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.DoubleToInt64Bits(result[0]) != ((left[0] > right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(result[i]) != ((left[i] > right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int16.cs new file mode 100644 index 00000000000000..7a307273a8cc80 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanInt16() + { + var test = new VectorBinaryOpTest__GreaterThanInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanInt16 testClass) + { + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanInt16(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] > right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] > right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int32.cs new file mode 100644 index 00000000000000..982572e7f7722b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanInt32() + { + var test = new VectorBinaryOpTest__GreaterThanInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanInt32 testClass) + { + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanInt32(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] > right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] > right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int64.cs new file mode 100644 index 00000000000000..80a5383b2e7316 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanInt64() + { + var test = new VectorBinaryOpTest__GreaterThanInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanInt64 testClass) + { + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanInt64(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] > right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] > right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.SByte.cs new file mode 100644 index 00000000000000..a1dcb6e7f2b5db --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.SByte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanSByte() + { + var test = new VectorBinaryOpTest__GreaterThanSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanSByte testClass) + { + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanSByte(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] > right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] > right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Single.cs new file mode 100644 index 00000000000000..e0b41d7ecca271 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Single.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanSingle() + { + var test = new VectorBinaryOpTest__GreaterThanSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanSingle testClass) + { + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanSingle(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.SingleToInt32Bits(result[0]) != ((left[0] > right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(result[i]) != ((left[i] > right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt16.cs new file mode 100644 index 00000000000000..e2f25006cccf2a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanUInt16() + { + var test = new VectorBinaryOpTest__GreaterThanUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanUInt16 testClass) + { + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanUInt16(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] > right[0]) ? ushort.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] > right[i]) ? ushort.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt32.cs new file mode 100644 index 00000000000000..33ac896f6f940c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanUInt32() + { + var test = new VectorBinaryOpTest__GreaterThanUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanUInt32 testClass) + { + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanUInt32(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] > right[0]) ? uint.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] > right[i]) ? uint.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt64.cs new file mode 100644 index 00000000000000..3ee3f79f58438c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanUInt64() + { + var test = new VectorBinaryOpTest__GreaterThanUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanUInt64 testClass) + { + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanUInt64(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] > right[0]) ? ulong.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] > right[i]) ? ulong.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Byte.cs new file mode 100644 index 00000000000000..6ba4b1a30bfd26 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Byte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAllByte() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAllByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAllByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAllByte testClass) + { + var result = Vector512.GreaterThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAllByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAllByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAllByte(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Double.cs new file mode 100644 index 00000000000000..08fca962581d19 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Double.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAllDouble() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAllDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAllDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAllDouble testClass) + { + var result = Vector512.GreaterThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAllDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAllDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAllDouble(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Double[] left, Double[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int16.cs new file mode 100644 index 00000000000000..0da4719f3c9da9 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAllInt16() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAllInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAllInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAllInt16 testClass) + { + var result = Vector512.GreaterThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAllInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAllInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAllInt16(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int32.cs new file mode 100644 index 00000000000000..cf8507148f6273 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAllInt32() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAllInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAllInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAllInt32 testClass) + { + var result = Vector512.GreaterThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAllInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAllInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAllInt32(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int64.cs new file mode 100644 index 00000000000000..e86ce9368c1bc4 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAllInt64() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAllInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAllInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAllInt64 testClass) + { + var result = Vector512.GreaterThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAllInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAllInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAllInt64(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.SByte.cs new file mode 100644 index 00000000000000..88d500e350c1fd --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.SByte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAllSByte() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAllSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAllSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAllSByte testClass) + { + var result = Vector512.GreaterThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAllSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAllSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAllSByte(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Single.cs new file mode 100644 index 00000000000000..8ed0e476f59279 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Single.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAllSingle() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAllSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAllSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAllSingle testClass) + { + var result = Vector512.GreaterThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAllSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAllSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAllSingle(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Single[] left, Single[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt16.cs new file mode 100644 index 00000000000000..745a76f4872080 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAllUInt16() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAllUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAllUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAllUInt16 testClass) + { + var result = Vector512.GreaterThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAllUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAllUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAllUInt16(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt32.cs new file mode 100644 index 00000000000000..e002036622b30d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAllUInt32() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAllUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAllUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAllUInt32 testClass) + { + var result = Vector512.GreaterThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAllUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAllUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAllUInt32(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt64.cs new file mode 100644 index 00000000000000..8a50e79e13af29 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAllUInt64() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAllUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAllUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAllUInt64 testClass) + { + var result = Vector512.GreaterThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAllUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAllUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAllUInt64(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Byte.cs new file mode 100644 index 00000000000000..914c6dc8716b62 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Byte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAnyByte() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAnyByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAnyByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAnyByte testClass) + { + var result = Vector512.GreaterThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAnyByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAnyByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAnyByte(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Double.cs new file mode 100644 index 00000000000000..dd29a3190f828a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Double.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAnyDouble() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAnyDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAnyDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAnyDouble testClass) + { + var result = Vector512.GreaterThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAnyDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAnyDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAnyDouble(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Double[] left, Double[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int16.cs new file mode 100644 index 00000000000000..fb01f74dc2657f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAnyInt16() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAnyInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAnyInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAnyInt16 testClass) + { + var result = Vector512.GreaterThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAnyInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAnyInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAnyInt16(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int32.cs new file mode 100644 index 00000000000000..6d6d9e1a3a9899 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAnyInt32() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAnyInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAnyInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAnyInt32 testClass) + { + var result = Vector512.GreaterThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAnyInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAnyInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAnyInt32(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int64.cs new file mode 100644 index 00000000000000..e5e83746e7af60 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAnyInt64() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAnyInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAnyInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAnyInt64 testClass) + { + var result = Vector512.GreaterThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAnyInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAnyInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAnyInt64(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.SByte.cs new file mode 100644 index 00000000000000..bb3291ff46f5a9 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.SByte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAnySByte() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAnySByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAnySByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAnySByte testClass) + { + var result = Vector512.GreaterThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAnySByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAnySByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAnySByte(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Single.cs new file mode 100644 index 00000000000000..281148d27e92e8 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Single.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAnySingle() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAnySingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAnySingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAnySingle testClass) + { + var result = Vector512.GreaterThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAnySingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAnySingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAnySingle(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Single[] left, Single[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt16.cs new file mode 100644 index 00000000000000..77534abdb297f2 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAnyUInt16() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAnyUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAnyUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAnyUInt16 testClass) + { + var result = Vector512.GreaterThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAnyUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAnyUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAnyUInt16(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt32.cs new file mode 100644 index 00000000000000..0249e722644b8d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAnyUInt32() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAnyUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAnyUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAnyUInt32 testClass) + { + var result = Vector512.GreaterThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAnyUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAnyUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAnyUInt32(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt64.cs new file mode 100644 index 00000000000000..76bcd96582864e --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanAnyUInt64() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanAnyUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanAnyUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanAnyUInt64 testClass) + { + var result = Vector512.GreaterThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanAnyUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanAnyUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanAnyUInt64(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] > right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Byte.cs new file mode 100644 index 00000000000000..791134c106fb4b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Byte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualByte() + { + var test = new VectorBinaryOpTest__GreaterThanOrEqualByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanOrEqualByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanOrEqualByte testClass) + { + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanOrEqualByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanOrEqualByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanOrEqualByte(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] >= right[0]) ? byte.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] >= right[i]) ? byte.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Double.cs new file mode 100644 index 00000000000000..d4c1b66b8338e8 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Double.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualDouble() + { + var test = new VectorBinaryOpTest__GreaterThanOrEqualDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanOrEqualDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanOrEqualDouble testClass) + { + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanOrEqualDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanOrEqualDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanOrEqualDouble(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.DoubleToInt64Bits(result[0]) != ((left[0] >= right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(result[i]) != ((left[i] >= right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int16.cs new file mode 100644 index 00000000000000..c9bfbd02da1e87 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualInt16() + { + var test = new VectorBinaryOpTest__GreaterThanOrEqualInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanOrEqualInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanOrEqualInt16 testClass) + { + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanOrEqualInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanOrEqualInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanOrEqualInt16(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] >= right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] >= right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int32.cs new file mode 100644 index 00000000000000..20836fee8208ab --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualInt32() + { + var test = new VectorBinaryOpTest__GreaterThanOrEqualInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanOrEqualInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanOrEqualInt32 testClass) + { + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanOrEqualInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanOrEqualInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanOrEqualInt32(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] >= right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] >= right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int64.cs new file mode 100644 index 00000000000000..10c435db656e59 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualInt64() + { + var test = new VectorBinaryOpTest__GreaterThanOrEqualInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanOrEqualInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanOrEqualInt64 testClass) + { + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanOrEqualInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanOrEqualInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanOrEqualInt64(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] >= right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] >= right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.SByte.cs new file mode 100644 index 00000000000000..df25f5e63792f1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.SByte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualSByte() + { + var test = new VectorBinaryOpTest__GreaterThanOrEqualSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanOrEqualSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanOrEqualSByte testClass) + { + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanOrEqualSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanOrEqualSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanOrEqualSByte(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] >= right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] >= right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Single.cs new file mode 100644 index 00000000000000..2d1fc2290652cf --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Single.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualSingle() + { + var test = new VectorBinaryOpTest__GreaterThanOrEqualSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanOrEqualSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanOrEqualSingle testClass) + { + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanOrEqualSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanOrEqualSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanOrEqualSingle(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.SingleToInt32Bits(result[0]) != ((left[0] >= right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(result[i]) != ((left[i] >= right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt16.cs new file mode 100644 index 00000000000000..fa568855793091 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualUInt16() + { + var test = new VectorBinaryOpTest__GreaterThanOrEqualUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanOrEqualUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanOrEqualUInt16 testClass) + { + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanOrEqualUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanOrEqualUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanOrEqualUInt16(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] >= right[0]) ? ushort.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] >= right[i]) ? ushort.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt32.cs new file mode 100644 index 00000000000000..fac9d97e44e357 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualUInt32() + { + var test = new VectorBinaryOpTest__GreaterThanOrEqualUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanOrEqualUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanOrEqualUInt32 testClass) + { + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanOrEqualUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanOrEqualUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanOrEqualUInt32(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] >= right[0]) ? uint.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] >= right[i]) ? uint.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt64.cs new file mode 100644 index 00000000000000..5ee9a22cc5d052 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualUInt64() + { + var test = new VectorBinaryOpTest__GreaterThanOrEqualUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__GreaterThanOrEqualUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__GreaterThanOrEqualUInt64 testClass) + { + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__GreaterThanOrEqualUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__GreaterThanOrEqualUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__GreaterThanOrEqualUInt64(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] >= right[0]) ? ulong.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] >= right[i]) ? ulong.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Byte.cs new file mode 100644 index 00000000000000..672c8c9f0832f5 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Byte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAllByte() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAllByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAllByte testClass) + { + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAllByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAllByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllByte(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Double.cs new file mode 100644 index 00000000000000..6ed7f694397d99 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Double.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAllDouble() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAllDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAllDouble testClass) + { + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAllDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAllDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllDouble(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Double[] left, Double[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int16.cs new file mode 100644 index 00000000000000..26cb33a5850b91 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAllInt16() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAllInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAllInt16 testClass) + { + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAllInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAllInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllInt16(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int32.cs new file mode 100644 index 00000000000000..eef3a46d3da10e --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAllInt32() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAllInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAllInt32 testClass) + { + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAllInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAllInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllInt32(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int64.cs new file mode 100644 index 00000000000000..0e0b3367efd0de --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAllInt64() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAllInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAllInt64 testClass) + { + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAllInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAllInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllInt64(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.SByte.cs new file mode 100644 index 00000000000000..5cdc190ab6e30e --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.SByte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAllSByte() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAllSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAllSByte testClass) + { + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAllSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAllSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllSByte(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Single.cs new file mode 100644 index 00000000000000..bd98aac64a5796 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Single.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAllSingle() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAllSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAllSingle testClass) + { + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAllSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAllSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllSingle(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Single[] left, Single[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt16.cs new file mode 100644 index 00000000000000..b9f54773cd5e43 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAllUInt16() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAllUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAllUInt16 testClass) + { + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAllUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAllUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllUInt16(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt32.cs new file mode 100644 index 00000000000000..0146997521d554 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAllUInt32() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAllUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAllUInt32 testClass) + { + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAllUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAllUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllUInt32(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt64.cs new file mode 100644 index 00000000000000..d4213c453de589 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAllUInt64() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAllUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAllUInt64 testClass) + { + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAllUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAllUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAllUInt64(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Byte.cs new file mode 100644 index 00000000000000..5328eb2f0f669a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Byte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAnyByte() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyByte testClass) + { + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyByte(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Double.cs new file mode 100644 index 00000000000000..0877e7ce512144 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Double.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAnyDouble() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyDouble testClass) + { + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyDouble(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Double[] left, Double[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int16.cs new file mode 100644 index 00000000000000..8d9945e64c477e --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAnyInt16() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyInt16 testClass) + { + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyInt16(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int32.cs new file mode 100644 index 00000000000000..931bfddd89b9f5 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAnyInt32() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyInt32 testClass) + { + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyInt32(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int64.cs new file mode 100644 index 00000000000000..6480185f3f47b2 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAnyInt64() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyInt64 testClass) + { + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyInt64(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.SByte.cs new file mode 100644 index 00000000000000..7738dd3f29a9f6 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.SByte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAnySByte() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnySByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAnySByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAnySByte testClass) + { + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAnySByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAnySByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnySByte(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Single.cs new file mode 100644 index 00000000000000..50fe73957b4edd --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Single.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAnySingle() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnySingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAnySingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAnySingle testClass) + { + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAnySingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAnySingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnySingle(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Single[] left, Single[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt16.cs new file mode 100644 index 00000000000000..53b76e3de84eeb --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAnyUInt16() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyUInt16 testClass) + { + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyUInt16(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt32.cs new file mode 100644 index 00000000000000..5485d568f7e163 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAnyUInt32() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyUInt32 testClass) + { + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyUInt32(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt64.cs new file mode 100644 index 00000000000000..dc8df86d3b37db --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void GreaterThanOrEqualAnyUInt64() + { + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyUInt64 testClass) + { + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.GreaterThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.GreaterThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.GreaterThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.GreaterThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__GreaterThanOrEqualAnyUInt64(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.GreaterThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.GreaterThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] >= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.GreaterThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Byte.cs new file mode 100644 index 00000000000000..1005fc0be5483f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Byte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanByte() + { + var test = new VectorBinaryOpTest__LessThanByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanByte testClass) + { + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanByte(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] < right[0]) ? byte.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] < right[i]) ? byte.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Double.cs new file mode 100644 index 00000000000000..228d2c5ec5a022 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Double.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanDouble() + { + var test = new VectorBinaryOpTest__LessThanDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanDouble testClass) + { + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanDouble(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.DoubleToInt64Bits(result[0]) != ((left[0] < right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(result[i]) != ((left[i] < right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int16.cs new file mode 100644 index 00000000000000..b04506f683efa7 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanInt16() + { + var test = new VectorBinaryOpTest__LessThanInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanInt16 testClass) + { + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanInt16(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] < right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] < right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int32.cs new file mode 100644 index 00000000000000..f6e666e9c87bee --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanInt32() + { + var test = new VectorBinaryOpTest__LessThanInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanInt32 testClass) + { + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanInt32(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] < right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] < right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int64.cs new file mode 100644 index 00000000000000..3e9992d0555cce --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanInt64() + { + var test = new VectorBinaryOpTest__LessThanInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanInt64 testClass) + { + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanInt64(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] < right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] < right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.SByte.cs new file mode 100644 index 00000000000000..82906e05158fab --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.SByte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanSByte() + { + var test = new VectorBinaryOpTest__LessThanSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanSByte testClass) + { + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanSByte(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] < right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] < right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Single.cs new file mode 100644 index 00000000000000..928a3eebccd95e --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Single.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanSingle() + { + var test = new VectorBinaryOpTest__LessThanSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanSingle testClass) + { + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanSingle(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.SingleToInt32Bits(result[0]) != ((left[0] < right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(result[i]) != ((left[i] < right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt16.cs new file mode 100644 index 00000000000000..d136318579e3ee --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanUInt16() + { + var test = new VectorBinaryOpTest__LessThanUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanUInt16 testClass) + { + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanUInt16(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] < right[0]) ? ushort.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] < right[i]) ? ushort.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt32.cs new file mode 100644 index 00000000000000..8eaff29e92cd71 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanUInt32() + { + var test = new VectorBinaryOpTest__LessThanUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanUInt32 testClass) + { + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanUInt32(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] < right[0]) ? uint.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] < right[i]) ? uint.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt64.cs new file mode 100644 index 00000000000000..0706fd701c26ad --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanUInt64() + { + var test = new VectorBinaryOpTest__LessThanUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanUInt64 testClass) + { + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThan( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThan), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThan( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThan(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanUInt64(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThan(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThan(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] < right[0]) ? ulong.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] < right[i]) ? ulong.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThan)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Byte.cs new file mode 100644 index 00000000000000..7fb760ac7586a3 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Byte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAllByte() + { + var test = new VectorBooleanBinaryOpTest__LessThanAllByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAllByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAllByte testClass) + { + var result = Vector512.LessThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAllByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAllByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAllByte(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Double.cs new file mode 100644 index 00000000000000..b294eb075ca5bb --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Double.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAllDouble() + { + var test = new VectorBooleanBinaryOpTest__LessThanAllDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAllDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAllDouble testClass) + { + var result = Vector512.LessThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAllDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAllDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAllDouble(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Double[] left, Double[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int16.cs new file mode 100644 index 00000000000000..b610f9f1c58446 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAllInt16() + { + var test = new VectorBooleanBinaryOpTest__LessThanAllInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAllInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAllInt16 testClass) + { + var result = Vector512.LessThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAllInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAllInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAllInt16(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int32.cs new file mode 100644 index 00000000000000..3664ddc81e1c1d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAllInt32() + { + var test = new VectorBooleanBinaryOpTest__LessThanAllInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAllInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAllInt32 testClass) + { + var result = Vector512.LessThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAllInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAllInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAllInt32(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int64.cs new file mode 100644 index 00000000000000..dd71e095a24368 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAllInt64() + { + var test = new VectorBooleanBinaryOpTest__LessThanAllInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAllInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAllInt64 testClass) + { + var result = Vector512.LessThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAllInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAllInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAllInt64(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.SByte.cs new file mode 100644 index 00000000000000..4301e2c54fcfee --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.SByte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAllSByte() + { + var test = new VectorBooleanBinaryOpTest__LessThanAllSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAllSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAllSByte testClass) + { + var result = Vector512.LessThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAllSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAllSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAllSByte(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Single.cs new file mode 100644 index 00000000000000..131d3f9fc7d013 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Single.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAllSingle() + { + var test = new VectorBooleanBinaryOpTest__LessThanAllSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAllSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAllSingle testClass) + { + var result = Vector512.LessThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAllSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAllSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAllSingle(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Single[] left, Single[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt16.cs new file mode 100644 index 00000000000000..9f794fb7b5f1d6 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAllUInt16() + { + var test = new VectorBooleanBinaryOpTest__LessThanAllUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAllUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAllUInt16 testClass) + { + var result = Vector512.LessThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAllUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAllUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAllUInt16(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt32.cs new file mode 100644 index 00000000000000..ed97ed16976e37 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAllUInt32() + { + var test = new VectorBooleanBinaryOpTest__LessThanAllUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAllUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAllUInt32 testClass) + { + var result = Vector512.LessThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAllUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAllUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAllUInt32(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt64.cs new file mode 100644 index 00000000000000..dc052f2d9f56dc --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAllUInt64() + { + var test = new VectorBooleanBinaryOpTest__LessThanAllUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAllUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAllUInt64 testClass) + { + var result = Vector512.LessThanAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAllUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAllUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAllUInt64(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Byte.cs new file mode 100644 index 00000000000000..f6365a2cb39e6d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Byte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAnyByte() + { + var test = new VectorBooleanBinaryOpTest__LessThanAnyByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAnyByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAnyByte testClass) + { + var result = Vector512.LessThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAnyByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAnyByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAnyByte(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Double.cs new file mode 100644 index 00000000000000..1ce0e74127011f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Double.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAnyDouble() + { + var test = new VectorBooleanBinaryOpTest__LessThanAnyDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAnyDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAnyDouble testClass) + { + var result = Vector512.LessThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAnyDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAnyDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAnyDouble(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Double[] left, Double[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int16.cs new file mode 100644 index 00000000000000..fae3937e961762 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAnyInt16() + { + var test = new VectorBooleanBinaryOpTest__LessThanAnyInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAnyInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAnyInt16 testClass) + { + var result = Vector512.LessThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAnyInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAnyInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAnyInt16(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int32.cs new file mode 100644 index 00000000000000..556cca19787d0a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAnyInt32() + { + var test = new VectorBooleanBinaryOpTest__LessThanAnyInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAnyInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAnyInt32 testClass) + { + var result = Vector512.LessThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAnyInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAnyInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAnyInt32(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int64.cs new file mode 100644 index 00000000000000..e2c4e916f2faf1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAnyInt64() + { + var test = new VectorBooleanBinaryOpTest__LessThanAnyInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAnyInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAnyInt64 testClass) + { + var result = Vector512.LessThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAnyInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAnyInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAnyInt64(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.SByte.cs new file mode 100644 index 00000000000000..2a3fbf6742f845 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.SByte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAnySByte() + { + var test = new VectorBooleanBinaryOpTest__LessThanAnySByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAnySByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAnySByte testClass) + { + var result = Vector512.LessThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAnySByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAnySByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAnySByte(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Single.cs new file mode 100644 index 00000000000000..6006c1f1f21efd --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Single.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAnySingle() + { + var test = new VectorBooleanBinaryOpTest__LessThanAnySingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAnySingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAnySingle testClass) + { + var result = Vector512.LessThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAnySingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAnySingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAnySingle(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Single[] left, Single[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt16.cs new file mode 100644 index 00000000000000..2dc55907b40184 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAnyUInt16() + { + var test = new VectorBooleanBinaryOpTest__LessThanAnyUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAnyUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAnyUInt16 testClass) + { + var result = Vector512.LessThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAnyUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAnyUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAnyUInt16(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt32.cs new file mode 100644 index 00000000000000..db2cc5c71b4761 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAnyUInt32() + { + var test = new VectorBooleanBinaryOpTest__LessThanAnyUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAnyUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAnyUInt32 testClass) + { + var result = Vector512.LessThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAnyUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAnyUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAnyUInt32(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt64.cs new file mode 100644 index 00000000000000..47af80b10ce00c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanAnyUInt64() + { + var test = new VectorBooleanBinaryOpTest__LessThanAnyUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanAnyUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanAnyUInt64 testClass) + { + var result = Vector512.LessThanAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanAnyUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanAnyUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanAnyUInt64(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] < right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Byte.cs new file mode 100644 index 00000000000000..602ed9a2cbaa5a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Byte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualByte() + { + var test = new VectorBinaryOpTest__LessThanOrEqualByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanOrEqualByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanOrEqualByte testClass) + { + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanOrEqualByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanOrEqualByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanOrEqualByte(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] <= right[0]) ? byte.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] <= right[i]) ? byte.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Double.cs new file mode 100644 index 00000000000000..cd9a0e7cae6889 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Double.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualDouble() + { + var test = new VectorBinaryOpTest__LessThanOrEqualDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanOrEqualDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanOrEqualDouble testClass) + { + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanOrEqualDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanOrEqualDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanOrEqualDouble(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.DoubleToInt64Bits(result[0]) != ((left[0] <= right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(result[i]) != ((left[i] <= right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int16.cs new file mode 100644 index 00000000000000..a3e8a412154cf1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualInt16() + { + var test = new VectorBinaryOpTest__LessThanOrEqualInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanOrEqualInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanOrEqualInt16 testClass) + { + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanOrEqualInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanOrEqualInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanOrEqualInt16(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] <= right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] <= right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int32.cs new file mode 100644 index 00000000000000..86331c7ec402f4 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualInt32() + { + var test = new VectorBinaryOpTest__LessThanOrEqualInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanOrEqualInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanOrEqualInt32 testClass) + { + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanOrEqualInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanOrEqualInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanOrEqualInt32(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] <= right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] <= right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int64.cs new file mode 100644 index 00000000000000..a3046dc132a0ba --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualInt64() + { + var test = new VectorBinaryOpTest__LessThanOrEqualInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanOrEqualInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanOrEqualInt64 testClass) + { + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanOrEqualInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanOrEqualInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanOrEqualInt64(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] <= right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] <= right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.SByte.cs new file mode 100644 index 00000000000000..9a13aad2eebca0 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.SByte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualSByte() + { + var test = new VectorBinaryOpTest__LessThanOrEqualSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanOrEqualSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanOrEqualSByte testClass) + { + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanOrEqualSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanOrEqualSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanOrEqualSByte(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] <= right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] <= right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Single.cs new file mode 100644 index 00000000000000..255e0df0c6bd11 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Single.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualSingle() + { + var test = new VectorBinaryOpTest__LessThanOrEqualSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanOrEqualSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanOrEqualSingle testClass) + { + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanOrEqualSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanOrEqualSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanOrEqualSingle(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.SingleToInt32Bits(result[0]) != ((left[0] <= right[0]) ? -1 : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(result[i]) != ((left[i] <= right[i]) ? -1 : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt16.cs new file mode 100644 index 00000000000000..d3bd6b6ed04ea1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualUInt16() + { + var test = new VectorBinaryOpTest__LessThanOrEqualUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanOrEqualUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanOrEqualUInt16 testClass) + { + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanOrEqualUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanOrEqualUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanOrEqualUInt16(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] <= right[0]) ? ushort.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] <= right[i]) ? ushort.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt32.cs new file mode 100644 index 00000000000000..4c995b89f889f4 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualUInt32() + { + var test = new VectorBinaryOpTest__LessThanOrEqualUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanOrEqualUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanOrEqualUInt32 testClass) + { + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanOrEqualUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanOrEqualUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanOrEqualUInt32(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] <= right[0]) ? uint.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] <= right[i]) ? uint.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt64.cs new file mode 100644 index 00000000000000..119d385606d687 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualUInt64() + { + var test = new VectorBinaryOpTest__LessThanOrEqualUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__LessThanOrEqualUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__LessThanOrEqualUInt64 testClass) + { + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__LessThanOrEqualUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__LessThanOrEqualUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqual( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqual), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqual( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqual(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__LessThanOrEqualUInt64(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqual(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqual(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] <= right[0]) ? ulong.MaxValue : 0)) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] <= right[i]) ? ulong.MaxValue : 0)) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqual)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Byte.cs new file mode 100644 index 00000000000000..b52b76f170d8fd --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Byte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAllByte() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAllByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAllByte testClass) + { + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAllByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAllByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllByte(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Double.cs new file mode 100644 index 00000000000000..03667ed7e1a230 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Double.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAllDouble() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAllDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAllDouble testClass) + { + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAllDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAllDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllDouble(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Double[] left, Double[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int16.cs new file mode 100644 index 00000000000000..8c84579fb58369 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAllInt16() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAllInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAllInt16 testClass) + { + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAllInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAllInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllInt16(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int32.cs new file mode 100644 index 00000000000000..60fd6a16cbb66a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAllInt32() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAllInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAllInt32 testClass) + { + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAllInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAllInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllInt32(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int64.cs new file mode 100644 index 00000000000000..554b3bcf746ddf --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAllInt64() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAllInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAllInt64 testClass) + { + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAllInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAllInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllInt64(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.SByte.cs new file mode 100644 index 00000000000000..a7fcf77c735320 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.SByte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAllSByte() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAllSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAllSByte testClass) + { + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAllSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAllSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllSByte(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Single.cs new file mode 100644 index 00000000000000..95e640cef60e14 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Single.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAllSingle() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAllSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAllSingle testClass) + { + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAllSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAllSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllSingle(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Single[] left, Single[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt16.cs new file mode 100644 index 00000000000000..626843a0facf86 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAllUInt16() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAllUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAllUInt16 testClass) + { + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAllUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAllUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllUInt16(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt32.cs new file mode 100644 index 00000000000000..fa2af2713923a7 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAllUInt32() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAllUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAllUInt32 testClass) + { + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAllUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAllUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllUInt32(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt64.cs new file mode 100644 index 00000000000000..a273398769d259 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAllUInt64() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAllUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAllUInt64 testClass) + { + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAllUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAllUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAll( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAll), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAll( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAll(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAllUInt64(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAll(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAll(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAll)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Byte.cs new file mode 100644 index 00000000000000..8546e8b8fedc89 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Byte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAnyByte() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnyByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAnyByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAnyByte testClass) + { + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAnyByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAnyByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnyByte(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Double.cs new file mode 100644 index 00000000000000..1ffbc8a393b2cd --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Double.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAnyDouble() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnyDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAnyDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAnyDouble testClass) + { + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAnyDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAnyDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnyDouble(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Double[] left, Double[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int16.cs new file mode 100644 index 00000000000000..0288498c694223 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAnyInt16() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnyInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAnyInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAnyInt16 testClass) + { + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAnyInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAnyInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnyInt16(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int32.cs new file mode 100644 index 00000000000000..e11d35eaede1c2 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAnyInt32() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnyInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAnyInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAnyInt32 testClass) + { + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAnyInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAnyInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnyInt32(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int64.cs new file mode 100644 index 00000000000000..872c7cd18c268d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAnyInt64() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnyInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAnyInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAnyInt64 testClass) + { + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAnyInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAnyInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnyInt64(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.SByte.cs new file mode 100644 index 00000000000000..61326dd358b9c3 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.SByte.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAnySByte() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnySByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAnySByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAnySByte testClass) + { + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAnySByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAnySByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnySByte(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Single.cs new file mode 100644 index 00000000000000..8e170b21e3efde --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Single.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAnySingle() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnySingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAnySingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAnySingle testClass) + { + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAnySingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAnySingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnySingle(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Single[] left, Single[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt16.cs new file mode 100644 index 00000000000000..ff7a113d0986a8 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt16.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAnyUInt16() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnyUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAnyUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAnyUInt16 testClass) + { + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAnyUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAnyUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnyUInt16(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt32.cs new file mode 100644 index 00000000000000..a1bd034b50ce47 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt32.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAnyUInt32() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnyUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAnyUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAnyUInt32 testClass) + { + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAnyUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAnyUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnyUInt32(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt64.cs new file mode 100644 index 00000000000000..56911f56293d18 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt64.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void LessThanOrEqualAnyUInt64() + { + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnyUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__LessThanOrEqualAnyUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__LessThanOrEqualAnyUInt64 testClass) + { + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__LessThanOrEqualAnyUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__LessThanOrEqualAnyUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.LessThanOrEqualAny( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.LessThanOrEqualAny), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.LessThanOrEqualAny( + _clsVar1, + _clsVar2 + ); + + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.LessThanOrEqualAny(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__LessThanOrEqualAnyUInt64(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.LessThanOrEqualAny(_fld1, _fld2); + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.LessThanOrEqualAny(test._fld1, test._fld2); + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = false; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] <= right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.LessThanOrEqualAny)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Byte.cs new file mode 100644 index 00000000000000..a3e8af4b157670 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Byte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MaxByte() + { + var test = new VectorBinaryOpTest__MaxByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MaxByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MaxByte testClass) + { + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MaxByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MaxByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Max( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Max), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Max), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Max( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Max(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MaxByte(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] > right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] > right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Max)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Double.cs new file mode 100644 index 00000000000000..fbcd10c2927744 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Double.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MaxDouble() + { + var test = new VectorBinaryOpTest__MaxDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MaxDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MaxDouble testClass) + { + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MaxDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MaxDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Max( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Max), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Max), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Max( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Max(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MaxDouble(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] > right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] > right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Max)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int16.cs new file mode 100644 index 00000000000000..9b40d972574ebb --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MaxInt16() + { + var test = new VectorBinaryOpTest__MaxInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MaxInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MaxInt16 testClass) + { + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MaxInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MaxInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Max( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Max), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Max), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Max( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Max(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MaxInt16(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] > right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] > right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Max)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int32.cs new file mode 100644 index 00000000000000..d77b909058ad02 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MaxInt32() + { + var test = new VectorBinaryOpTest__MaxInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MaxInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MaxInt32 testClass) + { + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MaxInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MaxInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Max( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Max), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Max), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Max( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Max(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MaxInt32(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] > right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] > right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Max)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int64.cs new file mode 100644 index 00000000000000..8acde7549e1621 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MaxInt64() + { + var test = new VectorBinaryOpTest__MaxInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MaxInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MaxInt64 testClass) + { + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MaxInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MaxInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Max( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Max), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Max), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Max( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Max(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MaxInt64(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] > right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] > right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Max)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.SByte.cs new file mode 100644 index 00000000000000..7fc4ef84b63fbe --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.SByte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MaxSByte() + { + var test = new VectorBinaryOpTest__MaxSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MaxSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MaxSByte testClass) + { + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MaxSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MaxSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Max( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Max), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Max), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Max( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Max(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MaxSByte(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] > right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] > right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Max)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Single.cs new file mode 100644 index 00000000000000..420b54f8070a59 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Single.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MaxSingle() + { + var test = new VectorBinaryOpTest__MaxSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MaxSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MaxSingle testClass) + { + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MaxSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MaxSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Max( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Max), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Max), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Max( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Max(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MaxSingle(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] > right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] > right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Max)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt16.cs new file mode 100644 index 00000000000000..1d97c5046293cd --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MaxUInt16() + { + var test = new VectorBinaryOpTest__MaxUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MaxUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MaxUInt16 testClass) + { + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MaxUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MaxUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Max( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Max), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Max), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Max( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Max(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MaxUInt16(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] > right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] > right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Max)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt32.cs new file mode 100644 index 00000000000000..8968945a47b2cd --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MaxUInt32() + { + var test = new VectorBinaryOpTest__MaxUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MaxUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MaxUInt32 testClass) + { + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MaxUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MaxUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Max( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Max), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Max), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Max( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Max(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MaxUInt32(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] > right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] > right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Max)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt64.cs new file mode 100644 index 00000000000000..42717fc448d892 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MaxUInt64() + { + var test = new VectorBinaryOpTest__MaxUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MaxUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MaxUInt64 testClass) + { + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MaxUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MaxUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Max( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Max), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Max), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Max( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Max(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MaxUInt64(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Max(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Max(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] > right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] > right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Max)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Byte.cs new file mode 100644 index 00000000000000..6a0f121ac99861 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Byte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MinByte() + { + var test = new VectorBinaryOpTest__MinByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MinByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MinByte testClass) + { + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MinByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MinByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Min( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Min), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Min), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Min( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Min(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MinByte(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] < right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] < right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Min)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Double.cs new file mode 100644 index 00000000000000..b805fa8c0200ad --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Double.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MinDouble() + { + var test = new VectorBinaryOpTest__MinDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MinDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MinDouble testClass) + { + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MinDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MinDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Min( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Min), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Min), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Min( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Min(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MinDouble(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] < right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] < right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Min)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int16.cs new file mode 100644 index 00000000000000..60008074031886 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MinInt16() + { + var test = new VectorBinaryOpTest__MinInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MinInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MinInt16 testClass) + { + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MinInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MinInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Min( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Min), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Min), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Min( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Min(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MinInt16(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] < right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] < right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Min)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int32.cs new file mode 100644 index 00000000000000..c5b40d6f13bdb6 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MinInt32() + { + var test = new VectorBinaryOpTest__MinInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MinInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MinInt32 testClass) + { + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MinInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MinInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Min( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Min), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Min), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Min( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Min(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MinInt32(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] < right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] < right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Min)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int64.cs new file mode 100644 index 00000000000000..635d8d0bc06128 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MinInt64() + { + var test = new VectorBinaryOpTest__MinInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MinInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MinInt64 testClass) + { + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MinInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MinInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Min( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Min), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Min), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Min( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Min(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MinInt64(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] < right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] < right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Min)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.SByte.cs new file mode 100644 index 00000000000000..207b18214d1370 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.SByte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MinSByte() + { + var test = new VectorBinaryOpTest__MinSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MinSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MinSByte testClass) + { + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MinSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MinSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Min( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Min), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Min), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Min( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Min(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MinSByte(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] < right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] < right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Min)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Single.cs new file mode 100644 index 00000000000000..10a6e00ceb5475 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Single.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MinSingle() + { + var test = new VectorBinaryOpTest__MinSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MinSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MinSingle testClass) + { + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MinSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MinSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Min( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Min), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Min), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Min( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Min(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MinSingle(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] < right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] < right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Min)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt16.cs new file mode 100644 index 00000000000000..4f238abc6b7154 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MinUInt16() + { + var test = new VectorBinaryOpTest__MinUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MinUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MinUInt16 testClass) + { + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MinUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MinUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Min( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Min), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Min), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Min( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Min(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MinUInt16(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] < right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] < right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Min)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt32.cs new file mode 100644 index 00000000000000..8665831712fd22 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MinUInt32() + { + var test = new VectorBinaryOpTest__MinUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MinUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MinUInt32 testClass) + { + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MinUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MinUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Min( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Min), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Min), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Min( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Min(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MinUInt32(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] < right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] < right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Min)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt64.cs new file mode 100644 index 00000000000000..31243c50e06883 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MinUInt64() + { + var test = new VectorBinaryOpTest__MinUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MinUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MinUInt64 testClass) + { + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MinUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MinUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Min( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Min), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Min), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Min( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Min(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MinUInt64(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Min(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Min(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != ((left[0] < right[0]) ? left[0] : right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != ((left[i] < right[i]) ? left[i] : right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Min)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Byte.cs new file mode 100644 index 00000000000000..0abdf2fd757ce0 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Byte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MultiplyByte() + { + var test = new VectorBinaryOpTest__MultiplyByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MultiplyByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MultiplyByte testClass) + { + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MultiplyByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MultiplyByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Multiply( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Multiply( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Multiply(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MultiplyByte(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Multiply)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Double.cs new file mode 100644 index 00000000000000..6c92ecc2dfba90 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Double.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MultiplyDouble() + { + var test = new VectorBinaryOpTest__MultiplyDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MultiplyDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MultiplyDouble testClass) + { + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MultiplyDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MultiplyDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Multiply( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Multiply( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Multiply(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MultiplyDouble(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (double)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (double)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Multiply)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int16.cs new file mode 100644 index 00000000000000..b1b201d0bdbc4c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MultiplyInt16() + { + var test = new VectorBinaryOpTest__MultiplyInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MultiplyInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MultiplyInt16 testClass) + { + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MultiplyInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MultiplyInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Multiply( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Multiply( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Multiply(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MultiplyInt16(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Multiply)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int32.cs new file mode 100644 index 00000000000000..ae963b2cfcebf5 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MultiplyInt32() + { + var test = new VectorBinaryOpTest__MultiplyInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MultiplyInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MultiplyInt32 testClass) + { + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MultiplyInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MultiplyInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Multiply( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Multiply( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Multiply(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MultiplyInt32(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Multiply)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int64.cs new file mode 100644 index 00000000000000..3f80fb554e3d32 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MultiplyInt64() + { + var test = new VectorBinaryOpTest__MultiplyInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MultiplyInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MultiplyInt64 testClass) + { + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MultiplyInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MultiplyInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Multiply( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Multiply( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Multiply(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MultiplyInt64(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Multiply)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.SByte.cs new file mode 100644 index 00000000000000..9f64a0a6ff388d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.SByte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MultiplySByte() + { + var test = new VectorBinaryOpTest__MultiplySByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MultiplySByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MultiplySByte testClass) + { + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MultiplySByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MultiplySByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Multiply( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Multiply( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Multiply(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MultiplySByte(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Multiply)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Single.cs new file mode 100644 index 00000000000000..6b623a9dc22e0f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Single.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MultiplySingle() + { + var test = new VectorBinaryOpTest__MultiplySingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MultiplySingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MultiplySingle testClass) + { + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MultiplySingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MultiplySingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Multiply( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Multiply( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Multiply(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MultiplySingle(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (float)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (float)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Multiply)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt16.cs new file mode 100644 index 00000000000000..9030ef586eb7c1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MultiplyUInt16() + { + var test = new VectorBinaryOpTest__MultiplyUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MultiplyUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MultiplyUInt16 testClass) + { + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MultiplyUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MultiplyUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Multiply( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Multiply( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Multiply(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MultiplyUInt16(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Multiply)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt32.cs new file mode 100644 index 00000000000000..b7b9760998a60a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MultiplyUInt32() + { + var test = new VectorBinaryOpTest__MultiplyUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MultiplyUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MultiplyUInt32 testClass) + { + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MultiplyUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MultiplyUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Multiply( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Multiply( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Multiply(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MultiplyUInt32(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Multiply)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt64.cs new file mode 100644 index 00000000000000..dddfd7bcb69a88 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void MultiplyUInt64() + { + var test = new VectorBinaryOpTest__MultiplyUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__MultiplyUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__MultiplyUInt64 testClass) + { + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__MultiplyUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__MultiplyUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Multiply( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Multiply), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Multiply( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Multiply(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__MultiplyUInt64(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Multiply(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Multiply(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Multiply)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Double.cs new file mode 100644 index 00000000000000..7f06d8a3735ec3 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Double.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void NarrowDouble() + { + var test = new VectorBinaryOpTest__NarrowDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__NarrowDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__NarrowDouble testClass) + { + var result = Vector512.Narrow(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__NarrowDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__NarrowDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Narrow( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Narrow), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Narrow), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Narrow( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Narrow(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__NarrowDouble(); + var result = Vector512.Narrow(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Narrow(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Narrow(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (float)(left[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (float)((i < Op1ElementCount) ? left[i] : right[i - Op1ElementCount])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Narrow)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int16.cs new file mode 100644 index 00000000000000..27ab763b5dc6ee --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void NarrowInt16() + { + var test = new VectorBinaryOpTest__NarrowInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__NarrowInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__NarrowInt16 testClass) + { + var result = Vector512.Narrow(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__NarrowInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__NarrowInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Narrow( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Narrow), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Narrow), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Narrow( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Narrow(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__NarrowInt16(); + var result = Vector512.Narrow(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Narrow(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Narrow(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(left[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)((i < Op1ElementCount) ? left[i] : right[i - Op1ElementCount])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Narrow)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int32.cs new file mode 100644 index 00000000000000..22ead69e740c2e --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void NarrowInt32() + { + var test = new VectorBinaryOpTest__NarrowInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__NarrowInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__NarrowInt32 testClass) + { + var result = Vector512.Narrow(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__NarrowInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__NarrowInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Narrow( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Narrow), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Narrow), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Narrow( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Narrow(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__NarrowInt32(); + var result = Vector512.Narrow(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Narrow(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Narrow(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(left[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)((i < Op1ElementCount) ? left[i] : right[i - Op1ElementCount])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Narrow)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int64.cs new file mode 100644 index 00000000000000..558fd169f8da13 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void NarrowInt64() + { + var test = new VectorBinaryOpTest__NarrowInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__NarrowInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__NarrowInt64 testClass) + { + var result = Vector512.Narrow(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__NarrowInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__NarrowInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Narrow( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Narrow), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Narrow), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Narrow( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Narrow(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__NarrowInt64(); + var result = Vector512.Narrow(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Narrow(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Narrow(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(left[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)((i < Op1ElementCount) ? left[i] : right[i - Op1ElementCount])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Narrow)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt16.cs new file mode 100644 index 00000000000000..a302527ad944e3 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void NarrowUInt16() + { + var test = new VectorBinaryOpTest__NarrowUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__NarrowUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__NarrowUInt16 testClass) + { + var result = Vector512.Narrow(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__NarrowUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__NarrowUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Narrow( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Narrow), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Narrow), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Narrow( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Narrow(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__NarrowUInt16(); + var result = Vector512.Narrow(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Narrow(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Narrow(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(left[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)((i < Op1ElementCount) ? left[i] : right[i - Op1ElementCount])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Narrow)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt32.cs new file mode 100644 index 00000000000000..4908d23cc76d1a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void NarrowUInt32() + { + var test = new VectorBinaryOpTest__NarrowUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__NarrowUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__NarrowUInt32 testClass) + { + var result = Vector512.Narrow(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__NarrowUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__NarrowUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Narrow( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Narrow), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Narrow), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Narrow( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Narrow(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__NarrowUInt32(); + var result = Vector512.Narrow(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Narrow(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Narrow(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(left[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)((i < Op1ElementCount) ? left[i] : right[i - Op1ElementCount])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Narrow)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt64.cs new file mode 100644 index 00000000000000..9a890333f3d963 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void NarrowUInt64() + { + var test = new VectorBinaryOpTest__NarrowUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__NarrowUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__NarrowUInt64 testClass) + { + var result = Vector512.Narrow(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__NarrowUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__NarrowUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Narrow( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Narrow), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Narrow), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Narrow( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Narrow(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__NarrowUInt64(); + var result = Vector512.Narrow(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Narrow(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Narrow(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(left[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)((i < Op1ElementCount) ? left[i] : right[i - Op1ElementCount])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Narrow)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Byte.cs new file mode 100644 index 00000000000000..f6ad0f1d46e855 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Byte.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void NegateByte() + { + var test = new VectorUnaryOpTest__NegateByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__NegateByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__NegateByte testClass) + { + var result = Vector512.Negate(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__NegateByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__NegateByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Negate( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Negate( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Negate(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__NegateByte(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Negate(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Byte[] firstOp, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Negate)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Double.cs new file mode 100644 index 00000000000000..d3126936ee8265 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Double.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void NegateDouble() + { + var test = new VectorUnaryOpTest__NegateDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__NegateDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__NegateDouble testClass) + { + var result = Vector512.Negate(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__NegateDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__NegateDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Negate( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Negate( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Negate(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__NegateDouble(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Negate(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (double)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (double)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Negate)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int16.cs new file mode 100644 index 00000000000000..66bb6831c1ccf1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int16.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void NegateInt16() + { + var test = new VectorUnaryOpTest__NegateInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__NegateInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__NegateInt16 testClass) + { + var result = Vector512.Negate(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__NegateInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__NegateInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Negate( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Negate( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Negate(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__NegateInt16(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Negate(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Negate)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int32.cs new file mode 100644 index 00000000000000..6973c203b61249 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int32.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void NegateInt32() + { + var test = new VectorUnaryOpTest__NegateInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__NegateInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__NegateInt32 testClass) + { + var result = Vector512.Negate(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__NegateInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__NegateInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Negate( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Negate( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Negate(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__NegateInt32(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Negate(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Negate)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int64.cs new file mode 100644 index 00000000000000..0042d7015e1a4b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int64.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void NegateInt64() + { + var test = new VectorUnaryOpTest__NegateInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__NegateInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__NegateInt64 testClass) + { + var result = Vector512.Negate(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__NegateInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__NegateInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Negate( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Negate( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Negate(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__NegateInt64(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Negate(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int64[] firstOp, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Negate)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.SByte.cs new file mode 100644 index 00000000000000..fe7c676b6e31a7 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.SByte.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void NegateSByte() + { + var test = new VectorUnaryOpTest__NegateSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__NegateSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__NegateSByte testClass) + { + var result = Vector512.Negate(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__NegateSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__NegateSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Negate( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Negate( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Negate(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__NegateSByte(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Negate(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(SByte[] firstOp, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Negate)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Single.cs new file mode 100644 index 00000000000000..6ae1bffc41555f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Single.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void NegateSingle() + { + var test = new VectorUnaryOpTest__NegateSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__NegateSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__NegateSingle testClass) + { + var result = Vector512.Negate(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__NegateSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__NegateSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Negate( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Negate( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Negate(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__NegateSingle(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Negate(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (float)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (float)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Negate)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt16.cs new file mode 100644 index 00000000000000..ee8f3e2aadb630 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt16.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void NegateUInt16() + { + var test = new VectorUnaryOpTest__NegateUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__NegateUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__NegateUInt16 testClass) + { + var result = Vector512.Negate(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__NegateUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__NegateUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Negate( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Negate( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Negate(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__NegateUInt16(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Negate(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt16[] firstOp, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Negate)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt32.cs new file mode 100644 index 00000000000000..b346b4a010efb5 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt32.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void NegateUInt32() + { + var test = new VectorUnaryOpTest__NegateUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__NegateUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__NegateUInt32 testClass) + { + var result = Vector512.Negate(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__NegateUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__NegateUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Negate( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Negate( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Negate(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__NegateUInt32(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Negate(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Negate)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt64.cs new file mode 100644 index 00000000000000..cc776540fd08cf --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt64.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void NegateUInt64() + { + var test = new VectorUnaryOpTest__NegateUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__NegateUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__NegateUInt64 testClass) + { + var result = Vector512.Negate(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__NegateUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__NegateUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Negate( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Negate), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Negate( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Negate(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__NegateUInt64(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Negate(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Negate(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt64[] firstOp, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Negate)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Byte.cs new file mode 100644 index 00000000000000..4bdc783dff3341 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Byte.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void OnesComplementByte() + { + var test = new VectorUnaryOpTest__OnesComplementByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__OnesComplementByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__OnesComplementByte testClass) + { + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__OnesComplementByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__OnesComplementByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.OnesComplement( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.OnesComplement( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.OnesComplement(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__OnesComplementByte(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Byte[] firstOp, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(~firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(~firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.OnesComplement)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Double.cs new file mode 100644 index 00000000000000..37b17811cb7e95 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Double.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void OnesComplementDouble() + { + var test = new VectorUnaryOpTest__OnesComplementDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__OnesComplementDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__OnesComplementDouble testClass) + { + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__OnesComplementDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__OnesComplementDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.OnesComplement( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.OnesComplement( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.OnesComplement(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__OnesComplementDouble(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.DoubleToInt64Bits(result[0]) != ~BitConverter.DoubleToInt64Bits(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(result[i]) != ~BitConverter.DoubleToInt64Bits(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.OnesComplement)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int16.cs new file mode 100644 index 00000000000000..3da580361aceca --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int16.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void OnesComplementInt16() + { + var test = new VectorUnaryOpTest__OnesComplementInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__OnesComplementInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__OnesComplementInt16 testClass) + { + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__OnesComplementInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__OnesComplementInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.OnesComplement( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.OnesComplement( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.OnesComplement(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__OnesComplementInt16(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(~firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(~firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.OnesComplement)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int32.cs new file mode 100644 index 00000000000000..667739cdbc811b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int32.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void OnesComplementInt32() + { + var test = new VectorUnaryOpTest__OnesComplementInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__OnesComplementInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__OnesComplementInt32 testClass) + { + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__OnesComplementInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__OnesComplementInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.OnesComplement( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.OnesComplement( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.OnesComplement(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__OnesComplementInt32(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(~firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(~firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.OnesComplement)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int64.cs new file mode 100644 index 00000000000000..953c81dc4492d4 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int64.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void OnesComplementInt64() + { + var test = new VectorUnaryOpTest__OnesComplementInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__OnesComplementInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__OnesComplementInt64 testClass) + { + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__OnesComplementInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__OnesComplementInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.OnesComplement( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.OnesComplement( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.OnesComplement(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__OnesComplementInt64(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int64[] firstOp, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(~firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(~firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.OnesComplement)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.SByte.cs new file mode 100644 index 00000000000000..69164d36d77b89 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.SByte.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void OnesComplementSByte() + { + var test = new VectorUnaryOpTest__OnesComplementSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__OnesComplementSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__OnesComplementSByte testClass) + { + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__OnesComplementSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__OnesComplementSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.OnesComplement( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.OnesComplement( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.OnesComplement(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__OnesComplementSByte(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(SByte[] firstOp, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(~firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(~firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.OnesComplement)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Single.cs new file mode 100644 index 00000000000000..5f5ac261a34282 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Single.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void OnesComplementSingle() + { + var test = new VectorUnaryOpTest__OnesComplementSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__OnesComplementSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__OnesComplementSingle testClass) + { + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__OnesComplementSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__OnesComplementSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.OnesComplement( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.OnesComplement( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.OnesComplement(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__OnesComplementSingle(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.SingleToInt32Bits(result[0]) != ~BitConverter.SingleToInt32Bits(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(result[i]) != ~BitConverter.SingleToInt32Bits(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.OnesComplement)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt16.cs new file mode 100644 index 00000000000000..89849cc83d5f48 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt16.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void OnesComplementUInt16() + { + var test = new VectorUnaryOpTest__OnesComplementUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__OnesComplementUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__OnesComplementUInt16 testClass) + { + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__OnesComplementUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__OnesComplementUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.OnesComplement( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.OnesComplement( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.OnesComplement(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__OnesComplementUInt16(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt16[] firstOp, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(~firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(~firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.OnesComplement)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt32.cs new file mode 100644 index 00000000000000..62fe0e6cb46ede --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt32.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void OnesComplementUInt32() + { + var test = new VectorUnaryOpTest__OnesComplementUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__OnesComplementUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__OnesComplementUInt32 testClass) + { + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__OnesComplementUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__OnesComplementUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.OnesComplement( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.OnesComplement( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.OnesComplement(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__OnesComplementUInt32(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(~firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(~firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.OnesComplement)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt64.cs new file mode 100644 index 00000000000000..aba64cdeb6b1f9 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt64.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void OnesComplementUInt64() + { + var test = new VectorUnaryOpTest__OnesComplementUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__OnesComplementUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__OnesComplementUInt64 testClass) + { + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__OnesComplementUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__OnesComplementUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.OnesComplement( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.OnesComplement), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.OnesComplement( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.OnesComplement(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__OnesComplementUInt64(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.OnesComplement(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.OnesComplement(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt64[] firstOp, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(~firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(~firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.OnesComplement)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Program.Vector512.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Program.Vector512.cs new file mode 100644 index 00000000000000..deff89ffa2f2c1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Program.Vector512.cs @@ -0,0 +1,16 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + static Program() + { + + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Byte.cs new file mode 100644 index 00000000000000..10f94bcba3bb5b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Byte.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SqrtByte() + { + var test = new VectorUnaryOpTest__SqrtByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__SqrtByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__SqrtByte testClass) + { + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__SqrtByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__SqrtByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Sqrt( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Sqrt( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Sqrt(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__SqrtByte(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Byte[] firstOp, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(MathF.Sqrt(firstOp[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(MathF.Sqrt(firstOp[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Sqrt)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Double.cs new file mode 100644 index 00000000000000..7c522fb81731e2 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Double.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SqrtDouble() + { + var test = new VectorUnaryOpTest__SqrtDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__SqrtDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__SqrtDouble testClass) + { + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__SqrtDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__SqrtDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Sqrt( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Sqrt( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Sqrt(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__SqrtDouble(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (double)(Math.Sqrt(firstOp[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (double)(Math.Sqrt(firstOp[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Sqrt)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int16.cs new file mode 100644 index 00000000000000..37049790f8370f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int16.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SqrtInt16() + { + var test = new VectorUnaryOpTest__SqrtInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__SqrtInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__SqrtInt16 testClass) + { + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__SqrtInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__SqrtInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Sqrt( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Sqrt( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Sqrt(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__SqrtInt16(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(MathF.Sqrt(firstOp[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(MathF.Sqrt(firstOp[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Sqrt)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int32.cs new file mode 100644 index 00000000000000..27e68642fca5e3 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int32.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SqrtInt32() + { + var test = new VectorUnaryOpTest__SqrtInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__SqrtInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__SqrtInt32 testClass) + { + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__SqrtInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__SqrtInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Sqrt( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Sqrt( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Sqrt(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__SqrtInt32(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(Math.Sqrt(firstOp[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(Math.Sqrt(firstOp[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Sqrt)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int64.cs new file mode 100644 index 00000000000000..b2349d0cd7f530 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int64.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SqrtInt64() + { + var test = new VectorUnaryOpTest__SqrtInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__SqrtInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__SqrtInt64 testClass) + { + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__SqrtInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__SqrtInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Sqrt( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Sqrt( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Sqrt(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__SqrtInt64(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int64[] firstOp, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(Math.Sqrt(firstOp[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(Math.Sqrt(firstOp[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Sqrt)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.SByte.cs new file mode 100644 index 00000000000000..8aec4c9e5517a1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.SByte.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SqrtSByte() + { + var test = new VectorUnaryOpTest__SqrtSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__SqrtSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__SqrtSByte testClass) + { + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__SqrtSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__SqrtSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Sqrt( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Sqrt( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Sqrt(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__SqrtSByte(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(SByte[] firstOp, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(MathF.Sqrt(firstOp[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(MathF.Sqrt(firstOp[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Sqrt)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Single.cs new file mode 100644 index 00000000000000..b26f24ee0dc803 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Single.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SqrtSingle() + { + var test = new VectorUnaryOpTest__SqrtSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__SqrtSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__SqrtSingle testClass) + { + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__SqrtSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__SqrtSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Sqrt( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Sqrt( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Sqrt(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__SqrtSingle(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (float)(MathF.Sqrt(firstOp[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (float)(MathF.Sqrt(firstOp[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Sqrt)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt16.cs new file mode 100644 index 00000000000000..8abf7baec91e92 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt16.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SqrtUInt16() + { + var test = new VectorUnaryOpTest__SqrtUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__SqrtUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__SqrtUInt16 testClass) + { + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__SqrtUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__SqrtUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Sqrt( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Sqrt( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Sqrt(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__SqrtUInt16(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt16[] firstOp, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(MathF.Sqrt(firstOp[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(MathF.Sqrt(firstOp[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Sqrt)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt32.cs new file mode 100644 index 00000000000000..eebe34a0a7b0c4 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt32.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SqrtUInt32() + { + var test = new VectorUnaryOpTest__SqrtUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__SqrtUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__SqrtUInt32 testClass) + { + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__SqrtUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__SqrtUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Sqrt( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Sqrt( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Sqrt(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__SqrtUInt32(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(Math.Sqrt(firstOp[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(Math.Sqrt(firstOp[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Sqrt)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt64.cs new file mode 100644 index 00000000000000..ec980f61494250 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt64.cs @@ -0,0 +1,315 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SqrtUInt64() + { + var test = new VectorUnaryOpTest__SqrtUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__SqrtUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__SqrtUInt64 testClass) + { + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__SqrtUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__SqrtUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Sqrt( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Sqrt), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Sqrt( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Sqrt(op1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__SqrtUInt64(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Sqrt(_fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Sqrt(test._fld1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt64[] firstOp, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(Math.Sqrt(firstOp[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(Math.Sqrt(firstOp[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Sqrt)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Byte.cs new file mode 100644 index 00000000000000..c6cb0660806b8e --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Byte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SubtractByte() + { + var test = new VectorBinaryOpTest__SubtractByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__SubtractByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__SubtractByte testClass) + { + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__SubtractByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__SubtractByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Subtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Subtract( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Subtract(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__SubtractByte(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Subtract)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Double.cs new file mode 100644 index 00000000000000..4c4761a28e5c2a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Double.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SubtractDouble() + { + var test = new VectorBinaryOpTest__SubtractDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__SubtractDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__SubtractDouble testClass) + { + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__SubtractDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__SubtractDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Subtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Subtract( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Subtract(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__SubtractDouble(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (double)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (double)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Subtract)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int16.cs new file mode 100644 index 00000000000000..4d9f31b8dc6777 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SubtractInt16() + { + var test = new VectorBinaryOpTest__SubtractInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__SubtractInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__SubtractInt16 testClass) + { + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__SubtractInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__SubtractInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Subtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Subtract( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Subtract(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__SubtractInt16(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Subtract)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int32.cs new file mode 100644 index 00000000000000..27c5723862e2a7 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SubtractInt32() + { + var test = new VectorBinaryOpTest__SubtractInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__SubtractInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__SubtractInt32 testClass) + { + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__SubtractInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__SubtractInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Subtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Subtract( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Subtract(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__SubtractInt32(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Subtract)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int64.cs new file mode 100644 index 00000000000000..d2e7fe3d57c23e --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SubtractInt64() + { + var test = new VectorBinaryOpTest__SubtractInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__SubtractInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__SubtractInt64 testClass) + { + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__SubtractInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__SubtractInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Subtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Subtract( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Subtract(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__SubtractInt64(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Subtract)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.SByte.cs new file mode 100644 index 00000000000000..9240add9f4932a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.SByte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SubtractSByte() + { + var test = new VectorBinaryOpTest__SubtractSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__SubtractSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__SubtractSByte testClass) + { + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__SubtractSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__SubtractSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Subtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Subtract( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Subtract(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__SubtractSByte(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Subtract)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Single.cs new file mode 100644 index 00000000000000..c3d1cc50b01c2b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Single.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SubtractSingle() + { + var test = new VectorBinaryOpTest__SubtractSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__SubtractSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__SubtractSingle testClass) + { + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__SubtractSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__SubtractSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Subtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Subtract( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Subtract(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__SubtractSingle(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (float)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (float)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Subtract)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt16.cs new file mode 100644 index 00000000000000..f7453639f3b59c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SubtractUInt16() + { + var test = new VectorBinaryOpTest__SubtractUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__SubtractUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__SubtractUInt16 testClass) + { + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__SubtractUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__SubtractUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Subtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Subtract( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Subtract(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__SubtractUInt16(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Subtract)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt32.cs new file mode 100644 index 00000000000000..37b1dc6096d518 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SubtractUInt32() + { + var test = new VectorBinaryOpTest__SubtractUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__SubtractUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__SubtractUInt32 testClass) + { + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__SubtractUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__SubtractUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Subtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Subtract( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Subtract(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__SubtractUInt32(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Subtract)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt64.cs new file mode 100644 index 00000000000000..36c1805cd9cdf1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void SubtractUInt64() + { + var test = new VectorBinaryOpTest__SubtractUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__SubtractUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__SubtractUInt64 testClass) + { + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__SubtractUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__SubtractUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Subtract( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Subtract), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Subtract( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Subtract(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__SubtractUInt64(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Subtract(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Subtract(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Subtract)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Vector512_r.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Vector512_r.csproj new file mode 100644 index 00000000000000..faba10dc82a601 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Vector512_r.csproj @@ -0,0 +1,400 @@ + + + false + true + + + Embedded + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Vector512_ro.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Vector512_ro.csproj new file mode 100644 index 00000000000000..6c9ba0dfb737c8 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Vector512_ro.csproj @@ -0,0 +1,400 @@ + + + false + true + + + Embedded + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Double.cs new file mode 100644 index 00000000000000..ab9051423d51e8 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Double.cs @@ -0,0 +1,337 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void WidenDouble() + { + var test = new VectorWidenTest__WidenDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorWidenTest__WidenDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outLowerArray; + private byte[] outUpperArray; + + private GCHandle inHandle1; + private GCHandle outLowerHandle; + private GCHandle outUpperHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Double[] outLowerArray, Double[] outUpperArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); + int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outLowerArray = new byte[alignment * 2]; + this.outUpperArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outLowerHandle = GCHandle.Alloc(this.outLowerArray, GCHandleType.Pinned); + this.outUpperHandle = GCHandle.Alloc(this.outUpperArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outLowerArrayPtr => Align((byte*)(outLowerHandle.AddrOfPinnedObject().ToPointer()), alignment); + public void* outUpperArrayPtr => Align((byte*)(outUpperHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outLowerHandle.Free(); + outUpperHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorWidenTest__WidenDouble testClass) + { + var result = Vector512.Widen(_fld1); + + Unsafe.Write(testClass._dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(testClass._dataTable.outUpperArrayPtr, result.Upper); + testClass.ValidateResult(_fld1, testClass._dataTable.outLowerArrayPtr, testClass._dataTable.outUpperArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Single[] _data1 = new Single[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorWidenTest__WidenDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorWidenTest__WidenDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, new Double[RetElementCount], new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Widen( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Widen), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Widen), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outLowerArrayPtr, (((Vector512 Lower, Vector512 Upper))(result)).Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, (((Vector512 Lower, Vector512 Upper))(result)).Upper); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Widen( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_clsVar1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Widen(op1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(op1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorWidenTest__WidenDouble(); + var result = Vector512.Widen(test._fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(test._fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Widen(_fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Widen(test._fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(test._fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* lowerResult, void* upperResult, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Double[] outLowerArray = new Double[RetElementCount]; + Double[] outUpperArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outLowerArray[0]), ref Unsafe.AsRef(lowerResult), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outUpperArray[0]), ref Unsafe.AsRef(upperResult), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outLowerArray, outUpperArray, method); + } + + private void ValidateResult(void* op1, void* lowerResult, void* upperResult, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Double[] outLowerArray = new Double[RetElementCount]; + Double[] outUpperArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outLowerArray[0]), ref Unsafe.AsRef(lowerResult), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outUpperArray[0]), ref Unsafe.AsRef(upperResult), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outLowerArray, outUpperArray, method); + } + + private void ValidateResult(Single[] firstOp, Double[] lowerResult, Double[] upperResult, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (lowerResult[i] != (double)(firstOp[i])) + { + succeeded = false; + break; + } + } + + for (var i = 0; i < RetElementCount; i++) + { + if (upperResult[i] != (double)(firstOp[i + RetElementCount])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Widen)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" lowerResult: ({string.Join(", ", lowerResult)})"); + TestLibrary.TestFramework.LogInformation($" upperResult: ({string.Join(", ", upperResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int16.cs new file mode 100644 index 00000000000000..4e3ef1bcd395ca --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int16.cs @@ -0,0 +1,337 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void WidenInt16() + { + var test = new VectorWidenTest__WidenInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorWidenTest__WidenInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outLowerArray; + private byte[] outUpperArray; + + private GCHandle inHandle1; + private GCHandle outLowerHandle; + private GCHandle outUpperHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, Int16[] outLowerArray, Int16[] outUpperArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); + int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outLowerArray = new byte[alignment * 2]; + this.outUpperArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outLowerHandle = GCHandle.Alloc(this.outLowerArray, GCHandleType.Pinned); + this.outUpperHandle = GCHandle.Alloc(this.outUpperArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outLowerArrayPtr => Align((byte*)(outLowerHandle.AddrOfPinnedObject().ToPointer()), alignment); + public void* outUpperArrayPtr => Align((byte*)(outUpperHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outLowerHandle.Free(); + outUpperHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorWidenTest__WidenInt16 testClass) + { + var result = Vector512.Widen(_fld1); + + Unsafe.Write(testClass._dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(testClass._dataTable.outUpperArrayPtr, result.Upper); + testClass.ValidateResult(_fld1, testClass._dataTable.outLowerArrayPtr, testClass._dataTable.outUpperArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorWidenTest__WidenInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorWidenTest__WidenInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, new Int16[RetElementCount], new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Widen( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Widen), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Widen), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outLowerArrayPtr, (((Vector512 Lower, Vector512 Upper))(result)).Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, (((Vector512 Lower, Vector512 Upper))(result)).Upper); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Widen( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_clsVar1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Widen(op1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(op1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorWidenTest__WidenInt16(); + var result = Vector512.Widen(test._fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(test._fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Widen(_fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Widen(test._fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(test._fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* lowerResult, void* upperResult, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + Int16[] outLowerArray = new Int16[RetElementCount]; + Int16[] outUpperArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outLowerArray[0]), ref Unsafe.AsRef(lowerResult), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outUpperArray[0]), ref Unsafe.AsRef(upperResult), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outLowerArray, outUpperArray, method); + } + + private void ValidateResult(void* op1, void* lowerResult, void* upperResult, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + Int16[] outLowerArray = new Int16[RetElementCount]; + Int16[] outUpperArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outLowerArray[0]), ref Unsafe.AsRef(lowerResult), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outUpperArray[0]), ref Unsafe.AsRef(upperResult), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outLowerArray, outUpperArray, method); + } + + private void ValidateResult(SByte[] firstOp, Int16[] lowerResult, Int16[] upperResult, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (lowerResult[i] != (short)(firstOp[i])) + { + succeeded = false; + break; + } + } + + for (var i = 0; i < RetElementCount; i++) + { + if (upperResult[i] != (short)(firstOp[i + RetElementCount])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Widen)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" lowerResult: ({string.Join(", ", lowerResult)})"); + TestLibrary.TestFramework.LogInformation($" upperResult: ({string.Join(", ", upperResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int32.cs new file mode 100644 index 00000000000000..df45c45d3051f5 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int32.cs @@ -0,0 +1,337 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void WidenInt32() + { + var test = new VectorWidenTest__WidenInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorWidenTest__WidenInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outLowerArray; + private byte[] outUpperArray; + + private GCHandle inHandle1; + private GCHandle outLowerHandle; + private GCHandle outUpperHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int32[] outLowerArray, Int32[] outUpperArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); + int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outLowerArray = new byte[alignment * 2]; + this.outUpperArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outLowerHandle = GCHandle.Alloc(this.outLowerArray, GCHandleType.Pinned); + this.outUpperHandle = GCHandle.Alloc(this.outUpperArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outLowerArrayPtr => Align((byte*)(outLowerHandle.AddrOfPinnedObject().ToPointer()), alignment); + public void* outUpperArrayPtr => Align((byte*)(outUpperHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outLowerHandle.Free(); + outUpperHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorWidenTest__WidenInt32 testClass) + { + var result = Vector512.Widen(_fld1); + + Unsafe.Write(testClass._dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(testClass._dataTable.outUpperArrayPtr, result.Upper); + testClass.ValidateResult(_fld1, testClass._dataTable.outLowerArrayPtr, testClass._dataTable.outUpperArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorWidenTest__WidenInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorWidenTest__WidenInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, new Int32[RetElementCount], new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Widen( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Widen), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Widen), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outLowerArrayPtr, (((Vector512 Lower, Vector512 Upper))(result)).Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, (((Vector512 Lower, Vector512 Upper))(result)).Upper); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Widen( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_clsVar1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Widen(op1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(op1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorWidenTest__WidenInt32(); + var result = Vector512.Widen(test._fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(test._fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Widen(_fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Widen(test._fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(test._fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* lowerResult, void* upperResult, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int32[] outLowerArray = new Int32[RetElementCount]; + Int32[] outUpperArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outLowerArray[0]), ref Unsafe.AsRef(lowerResult), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outUpperArray[0]), ref Unsafe.AsRef(upperResult), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outLowerArray, outUpperArray, method); + } + + private void ValidateResult(void* op1, void* lowerResult, void* upperResult, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int32[] outLowerArray = new Int32[RetElementCount]; + Int32[] outUpperArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outLowerArray[0]), ref Unsafe.AsRef(lowerResult), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outUpperArray[0]), ref Unsafe.AsRef(upperResult), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outLowerArray, outUpperArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int32[] lowerResult, Int32[] upperResult, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (lowerResult[i] != (int)(firstOp[i])) + { + succeeded = false; + break; + } + } + + for (var i = 0; i < RetElementCount; i++) + { + if (upperResult[i] != (int)(firstOp[i + RetElementCount])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Widen)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" lowerResult: ({string.Join(", ", lowerResult)})"); + TestLibrary.TestFramework.LogInformation($" upperResult: ({string.Join(", ", upperResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int64.cs new file mode 100644 index 00000000000000..1db881fefd4a39 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int64.cs @@ -0,0 +1,337 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void WidenInt64() + { + var test = new VectorWidenTest__WidenInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorWidenTest__WidenInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outLowerArray; + private byte[] outUpperArray; + + private GCHandle inHandle1; + private GCHandle outLowerHandle; + private GCHandle outUpperHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int64[] outLowerArray, Int64[] outUpperArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); + int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outLowerArray = new byte[alignment * 2]; + this.outUpperArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outLowerHandle = GCHandle.Alloc(this.outLowerArray, GCHandleType.Pinned); + this.outUpperHandle = GCHandle.Alloc(this.outUpperArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outLowerArrayPtr => Align((byte*)(outLowerHandle.AddrOfPinnedObject().ToPointer()), alignment); + public void* outUpperArrayPtr => Align((byte*)(outUpperHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outLowerHandle.Free(); + outUpperHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorWidenTest__WidenInt64 testClass) + { + var result = Vector512.Widen(_fld1); + + Unsafe.Write(testClass._dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(testClass._dataTable.outUpperArrayPtr, result.Upper); + testClass.ValidateResult(_fld1, testClass._dataTable.outLowerArrayPtr, testClass._dataTable.outUpperArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorWidenTest__WidenInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorWidenTest__WidenInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, new Int64[RetElementCount], new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Widen( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Widen), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Widen), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outLowerArrayPtr, (((Vector512 Lower, Vector512 Upper))(result)).Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, (((Vector512 Lower, Vector512 Upper))(result)).Upper); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Widen( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_clsVar1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Widen(op1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(op1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorWidenTest__WidenInt64(); + var result = Vector512.Widen(test._fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(test._fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Widen(_fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Widen(test._fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(test._fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* lowerResult, void* upperResult, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int64[] outLowerArray = new Int64[RetElementCount]; + Int64[] outUpperArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outLowerArray[0]), ref Unsafe.AsRef(lowerResult), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outUpperArray[0]), ref Unsafe.AsRef(upperResult), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outLowerArray, outUpperArray, method); + } + + private void ValidateResult(void* op1, void* lowerResult, void* upperResult, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int64[] outLowerArray = new Int64[RetElementCount]; + Int64[] outUpperArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outLowerArray[0]), ref Unsafe.AsRef(lowerResult), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outUpperArray[0]), ref Unsafe.AsRef(upperResult), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outLowerArray, outUpperArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int64[] lowerResult, Int64[] upperResult, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (lowerResult[i] != (long)(firstOp[i])) + { + succeeded = false; + break; + } + } + + for (var i = 0; i < RetElementCount; i++) + { + if (upperResult[i] != (long)(firstOp[i + RetElementCount])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Widen)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" lowerResult: ({string.Join(", ", lowerResult)})"); + TestLibrary.TestFramework.LogInformation($" upperResult: ({string.Join(", ", upperResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt16.cs new file mode 100644 index 00000000000000..a0d60243cacd22 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt16.cs @@ -0,0 +1,337 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void WidenUInt16() + { + var test = new VectorWidenTest__WidenUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorWidenTest__WidenUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outLowerArray; + private byte[] outUpperArray; + + private GCHandle inHandle1; + private GCHandle outLowerHandle; + private GCHandle outUpperHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, UInt16[] outLowerArray, UInt16[] outUpperArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); + int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outLowerArray = new byte[alignment * 2]; + this.outUpperArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outLowerHandle = GCHandle.Alloc(this.outLowerArray, GCHandleType.Pinned); + this.outUpperHandle = GCHandle.Alloc(this.outUpperArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outLowerArrayPtr => Align((byte*)(outLowerHandle.AddrOfPinnedObject().ToPointer()), alignment); + public void* outUpperArrayPtr => Align((byte*)(outUpperHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outLowerHandle.Free(); + outUpperHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorWidenTest__WidenUInt16 testClass) + { + var result = Vector512.Widen(_fld1); + + Unsafe.Write(testClass._dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(testClass._dataTable.outUpperArrayPtr, result.Upper); + testClass.ValidateResult(_fld1, testClass._dataTable.outLowerArrayPtr, testClass._dataTable.outUpperArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorWidenTest__WidenUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorWidenTest__WidenUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, new UInt16[RetElementCount], new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Widen( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Widen), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Widen), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outLowerArrayPtr, (((Vector512 Lower, Vector512 Upper))(result)).Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, (((Vector512 Lower, Vector512 Upper))(result)).Upper); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Widen( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_clsVar1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Widen(op1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(op1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorWidenTest__WidenUInt16(); + var result = Vector512.Widen(test._fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(test._fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Widen(_fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Widen(test._fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(test._fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* lowerResult, void* upperResult, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + UInt16[] outLowerArray = new UInt16[RetElementCount]; + UInt16[] outUpperArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outLowerArray[0]), ref Unsafe.AsRef(lowerResult), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outUpperArray[0]), ref Unsafe.AsRef(upperResult), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outLowerArray, outUpperArray, method); + } + + private void ValidateResult(void* op1, void* lowerResult, void* upperResult, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + UInt16[] outLowerArray = new UInt16[RetElementCount]; + UInt16[] outUpperArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outLowerArray[0]), ref Unsafe.AsRef(lowerResult), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outUpperArray[0]), ref Unsafe.AsRef(upperResult), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outLowerArray, outUpperArray, method); + } + + private void ValidateResult(Byte[] firstOp, UInt16[] lowerResult, UInt16[] upperResult, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (lowerResult[i] != (ushort)(firstOp[i])) + { + succeeded = false; + break; + } + } + + for (var i = 0; i < RetElementCount; i++) + { + if (upperResult[i] != (ushort)(firstOp[i + RetElementCount])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Widen)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" lowerResult: ({string.Join(", ", lowerResult)})"); + TestLibrary.TestFramework.LogInformation($" upperResult: ({string.Join(", ", upperResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt32.cs new file mode 100644 index 00000000000000..b2484da4e93d16 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt32.cs @@ -0,0 +1,337 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void WidenUInt32() + { + var test = new VectorWidenTest__WidenUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorWidenTest__WidenUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outLowerArray; + private byte[] outUpperArray; + + private GCHandle inHandle1; + private GCHandle outLowerHandle; + private GCHandle outUpperHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt32[] outLowerArray, UInt32[] outUpperArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); + int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outLowerArray = new byte[alignment * 2]; + this.outUpperArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outLowerHandle = GCHandle.Alloc(this.outLowerArray, GCHandleType.Pinned); + this.outUpperHandle = GCHandle.Alloc(this.outUpperArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outLowerArrayPtr => Align((byte*)(outLowerHandle.AddrOfPinnedObject().ToPointer()), alignment); + public void* outUpperArrayPtr => Align((byte*)(outUpperHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outLowerHandle.Free(); + outUpperHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorWidenTest__WidenUInt32 testClass) + { + var result = Vector512.Widen(_fld1); + + Unsafe.Write(testClass._dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(testClass._dataTable.outUpperArrayPtr, result.Upper); + testClass.ValidateResult(_fld1, testClass._dataTable.outLowerArrayPtr, testClass._dataTable.outUpperArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorWidenTest__WidenUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorWidenTest__WidenUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, new UInt32[RetElementCount], new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Widen( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Widen), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Widen), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outLowerArrayPtr, (((Vector512 Lower, Vector512 Upper))(result)).Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, (((Vector512 Lower, Vector512 Upper))(result)).Upper); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Widen( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_clsVar1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Widen(op1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(op1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorWidenTest__WidenUInt32(); + var result = Vector512.Widen(test._fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(test._fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Widen(_fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Widen(test._fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(test._fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* lowerResult, void* upperResult, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt32[] outLowerArray = new UInt32[RetElementCount]; + UInt32[] outUpperArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outLowerArray[0]), ref Unsafe.AsRef(lowerResult), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outUpperArray[0]), ref Unsafe.AsRef(upperResult), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outLowerArray, outUpperArray, method); + } + + private void ValidateResult(void* op1, void* lowerResult, void* upperResult, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt32[] outLowerArray = new UInt32[RetElementCount]; + UInt32[] outUpperArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outLowerArray[0]), ref Unsafe.AsRef(lowerResult), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outUpperArray[0]), ref Unsafe.AsRef(upperResult), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outLowerArray, outUpperArray, method); + } + + private void ValidateResult(UInt16[] firstOp, UInt32[] lowerResult, UInt32[] upperResult, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (lowerResult[i] != (uint)(firstOp[i])) + { + succeeded = false; + break; + } + } + + for (var i = 0; i < RetElementCount; i++) + { + if (upperResult[i] != (uint)(firstOp[i + RetElementCount])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Widen)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" lowerResult: ({string.Join(", ", lowerResult)})"); + TestLibrary.TestFramework.LogInformation($" upperResult: ({string.Join(", ", upperResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt64.cs new file mode 100644 index 00000000000000..c724c712f1b475 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt64.cs @@ -0,0 +1,337 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void WidenUInt64() + { + var test = new VectorWidenTest__WidenUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorWidenTest__WidenUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outLowerArray; + private byte[] outUpperArray; + + private GCHandle inHandle1; + private GCHandle outLowerHandle; + private GCHandle outUpperHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt64[] outLowerArray, UInt64[] outUpperArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); + int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outLowerArray = new byte[alignment * 2]; + this.outUpperArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outLowerHandle = GCHandle.Alloc(this.outLowerArray, GCHandleType.Pinned); + this.outUpperHandle = GCHandle.Alloc(this.outUpperArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outLowerArrayPtr => Align((byte*)(outLowerHandle.AddrOfPinnedObject().ToPointer()), alignment); + public void* outUpperArrayPtr => Align((byte*)(outUpperHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outLowerHandle.Free(); + outUpperHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorWidenTest__WidenUInt64 testClass) + { + var result = Vector512.Widen(_fld1); + + Unsafe.Write(testClass._dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(testClass._dataTable.outUpperArrayPtr, result.Upper); + testClass.ValidateResult(_fld1, testClass._dataTable.outLowerArrayPtr, testClass._dataTable.outUpperArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorWidenTest__WidenUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorWidenTest__WidenUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, new UInt64[RetElementCount], new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Widen( + Unsafe.Read>(_dataTable.inArray1Ptr) + ); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Widen), new Type[] { + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Widen), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outLowerArrayPtr, (((Vector512 Lower, Vector512 Upper))(result)).Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, (((Vector512 Lower, Vector512 Upper))(result)).Upper); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Widen( + _clsVar1 + ); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_clsVar1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = Vector512.Widen(op1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(op1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorWidenTest__WidenUInt64(); + var result = Vector512.Widen(test._fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(test._fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Widen(_fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(_fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Widen(test._fld1); + + Unsafe.Write(_dataTable.outLowerArrayPtr, result.Lower); + Unsafe.Write(_dataTable.outUpperArrayPtr, result.Upper); + ValidateResult(test._fld1, _dataTable.outLowerArrayPtr, _dataTable.outUpperArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* lowerResult, void* upperResult, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt64[] outLowerArray = new UInt64[RetElementCount]; + UInt64[] outUpperArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outLowerArray[0]), ref Unsafe.AsRef(lowerResult), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outUpperArray[0]), ref Unsafe.AsRef(upperResult), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outLowerArray, outUpperArray, method); + } + + private void ValidateResult(void* op1, void* lowerResult, void* upperResult, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt64[] outLowerArray = new UInt64[RetElementCount]; + UInt64[] outUpperArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outLowerArray[0]), ref Unsafe.AsRef(lowerResult), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outUpperArray[0]), ref Unsafe.AsRef(upperResult), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outLowerArray, outUpperArray, method); + } + + private void ValidateResult(UInt32[] firstOp, UInt64[] lowerResult, UInt64[] upperResult, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (lowerResult[i] != (ulong)(firstOp[i])) + { + succeeded = false; + break; + } + } + + for (var i = 0; i < RetElementCount; i++) + { + if (upperResult[i] != (ulong)(firstOp[i + RetElementCount])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Widen)}(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" lowerResult: ({string.Join(", ", lowerResult)})"); + TestLibrary.TestFramework.LogInformation($" upperResult: ({string.Join(", ", upperResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Byte.cs new file mode 100644 index 00000000000000..314369bff68e50 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Byte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void XorByte() + { + var test = new VectorBinaryOpTest__XorByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__XorByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__XorByte testClass) + { + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__XorByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__XorByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Xor( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Byte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Xor( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Xor(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__XorByte(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(left[0] ^ right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(left[i] ^ right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Xor)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Double.cs new file mode 100644 index 00000000000000..d4010e546c3f15 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Double.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void XorDouble() + { + var test = new VectorBinaryOpTest__XorDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__XorDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__XorDouble testClass) + { + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__XorDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__XorDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Xor( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Double)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Xor( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Xor(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__XorDouble(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.DoubleToInt64Bits(result[0]) != (BitConverter.DoubleToInt64Bits(left[0]) ^ BitConverter.DoubleToInt64Bits(right[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(result[i]) != (BitConverter.DoubleToInt64Bits(left[i]) ^ BitConverter.DoubleToInt64Bits(right[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Xor)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int16.cs new file mode 100644 index 00000000000000..6ffb4e29802bc0 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void XorInt16() + { + var test = new VectorBinaryOpTest__XorInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__XorInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__XorInt16 testClass) + { + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__XorInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__XorInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Xor( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Xor( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Xor(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__XorInt16(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(left[0] ^ right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(left[i] ^ right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Xor)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int32.cs new file mode 100644 index 00000000000000..c06f0df05dff43 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void XorInt32() + { + var test = new VectorBinaryOpTest__XorInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__XorInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__XorInt32 testClass) + { + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__XorInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__XorInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Xor( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Xor( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Xor(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__XorInt32(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(left[0] ^ right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(left[i] ^ right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Xor)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int64.cs new file mode 100644 index 00000000000000..3566f2f80642b2 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void XorInt64() + { + var test = new VectorBinaryOpTest__XorInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__XorInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__XorInt64 testClass) + { + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__XorInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__XorInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Xor( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Int64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Xor( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Xor(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__XorInt64(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(left[0] ^ right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(left[i] ^ right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Xor)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.SByte.cs new file mode 100644 index 00000000000000..4e7a096356db6f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.SByte.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void XorSByte() + { + var test = new VectorBinaryOpTest__XorSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__XorSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__XorSByte testClass) + { + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__XorSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__XorSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Xor( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(SByte)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Xor( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Xor(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__XorSByte(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(left[0] ^ right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(left[i] ^ right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Xor)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Single.cs new file mode 100644 index 00000000000000..3ce732de6e05fb --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Single.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void XorSingle() + { + var test = new VectorBinaryOpTest__XorSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__XorSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__XorSingle testClass) + { + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__XorSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__XorSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Xor( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(Single)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Xor( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Xor(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__XorSingle(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.SingleToInt32Bits(result[0]) != (BitConverter.SingleToInt32Bits(left[0]) ^ BitConverter.SingleToInt32Bits(right[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(result[i]) != (BitConverter.SingleToInt32Bits(left[i]) ^ BitConverter.SingleToInt32Bits(right[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Xor)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt16.cs new file mode 100644 index 00000000000000..654621d11ff83d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt16.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void XorUInt16() + { + var test = new VectorBinaryOpTest__XorUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__XorUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__XorUInt16 testClass) + { + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__XorUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__XorUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Xor( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt16)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Xor( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Xor(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__XorUInt16(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(left[0] ^ right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(left[i] ^ right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Xor)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt32.cs new file mode 100644 index 00000000000000..3212b2f02ba414 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt32.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void XorUInt32() + { + var test = new VectorBinaryOpTest__XorUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__XorUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__XorUInt32 testClass) + { + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__XorUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__XorUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Xor( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt32)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Xor( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Xor(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__XorUInt32(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(left[0] ^ right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(left[i] ^ right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Xor)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt64.cs new file mode 100644 index 00000000000000..750463dd0274e7 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt64.cs @@ -0,0 +1,346 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512 +{ + public static partial class Program + { + [Fact] + public static void XorUInt64() + { + var test = new VectorBinaryOpTest__XorUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__XorUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__XorUInt64 testClass) + { + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__XorUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__XorUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Vector512.Xor( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), new Type[] { + typeof(Vector512), + typeof(Vector512) + }); + + if (method is null) + { + method = typeof(Vector512).GetMethod(nameof(Vector512.Xor), 1, new Type[] { + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), + typeof(Vector512<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) + }); + } + + if (method.IsGenericMethodDefinition) + { + method = method.MakeGenericMethod(typeof(UInt64)); + } + + var result = method.Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Vector512.Xor( + _clsVar1, + _clsVar2 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = Vector512.Xor(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__XorUInt64(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Vector512.Xor(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Vector512.Xor(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(left[0] ^ right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(left[i] ^ right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.{nameof(Vector512.Xor)}(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Byte.cs new file mode 100644 index 00000000000000..18713891aa4cb6 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Byte.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AllBitsSetByte() + { + var test = new VectorAllBitsSet__AllBitsSetByte(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAllBitsSet__AllBitsSetByte + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.AllBitsSet; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.AllBitsSet), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + Byte[] resultElements = new Byte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private unsafe void ValidateResult(Byte[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + for (var i = 0; i < ElementCount; i++) + { + if (!HasAllBitsSet(resultElements[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AllBitsSet(Byte): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private unsafe bool HasAllBitsSet(Byte value) + { + for (int i = 0; i < sizeof(Byte); i++) + { + if (((byte*)&value)[i] != 0xFF) + return false; + } + return true; + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Double.cs new file mode 100644 index 00000000000000..97943a9ae3a762 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Double.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AllBitsSetDouble() + { + var test = new VectorAllBitsSet__AllBitsSetDouble(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAllBitsSet__AllBitsSetDouble + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.AllBitsSet; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.AllBitsSet), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + Double[] resultElements = new Double[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private unsafe void ValidateResult(Double[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + for (var i = 0; i < ElementCount; i++) + { + if (!HasAllBitsSet(resultElements[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AllBitsSet(Double): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private unsafe bool HasAllBitsSet(Double value) + { + for (int i = 0; i < sizeof(Double); i++) + { + if (((byte*)&value)[i] != 0xFF) + return false; + } + return true; + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Int16.cs new file mode 100644 index 00000000000000..27cc01d70790f3 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Int16.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AllBitsSetInt16() + { + var test = new VectorAllBitsSet__AllBitsSetInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAllBitsSet__AllBitsSetInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.AllBitsSet; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.AllBitsSet), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + Int16[] resultElements = new Int16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private unsafe void ValidateResult(Int16[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + for (var i = 0; i < ElementCount; i++) + { + if (!HasAllBitsSet(resultElements[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AllBitsSet(Int16): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private unsafe bool HasAllBitsSet(Int16 value) + { + for (int i = 0; i < sizeof(Int16); i++) + { + if (((byte*)&value)[i] != 0xFF) + return false; + } + return true; + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Int32.cs new file mode 100644 index 00000000000000..d22352476ee856 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Int32.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AllBitsSetInt32() + { + var test = new VectorAllBitsSet__AllBitsSetInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAllBitsSet__AllBitsSetInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.AllBitsSet; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.AllBitsSet), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + Int32[] resultElements = new Int32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private unsafe void ValidateResult(Int32[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + for (var i = 0; i < ElementCount; i++) + { + if (!HasAllBitsSet(resultElements[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AllBitsSet(Int32): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private unsafe bool HasAllBitsSet(Int32 value) + { + for (int i = 0; i < sizeof(Int32); i++) + { + if (((byte*)&value)[i] != 0xFF) + return false; + } + return true; + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Int64.cs new file mode 100644 index 00000000000000..88e023e235d641 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Int64.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AllBitsSetInt64() + { + var test = new VectorAllBitsSet__AllBitsSetInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAllBitsSet__AllBitsSetInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.AllBitsSet; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.AllBitsSet), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + Int64[] resultElements = new Int64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private unsafe void ValidateResult(Int64[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + for (var i = 0; i < ElementCount; i++) + { + if (!HasAllBitsSet(resultElements[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AllBitsSet(Int64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private unsafe bool HasAllBitsSet(Int64 value) + { + for (int i = 0; i < sizeof(Int64); i++) + { + if (((byte*)&value)[i] != 0xFF) + return false; + } + return true; + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.SByte.cs new file mode 100644 index 00000000000000..fc67925465948a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.SByte.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AllBitsSetSByte() + { + var test = new VectorAllBitsSet__AllBitsSetSByte(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAllBitsSet__AllBitsSetSByte + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.AllBitsSet; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.AllBitsSet), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + SByte[] resultElements = new SByte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private unsafe void ValidateResult(SByte[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + for (var i = 0; i < ElementCount; i++) + { + if (!HasAllBitsSet(resultElements[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AllBitsSet(SByte): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private unsafe bool HasAllBitsSet(SByte value) + { + for (int i = 0; i < sizeof(SByte); i++) + { + if (((byte*)&value)[i] != 0xFF) + return false; + } + return true; + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Single.cs new file mode 100644 index 00000000000000..c6f62ee1016d3a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.Single.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AllBitsSetSingle() + { + var test = new VectorAllBitsSet__AllBitsSetSingle(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAllBitsSet__AllBitsSetSingle + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.AllBitsSet; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.AllBitsSet), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + Single[] resultElements = new Single[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private unsafe void ValidateResult(Single[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + for (var i = 0; i < ElementCount; i++) + { + if (!HasAllBitsSet(resultElements[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AllBitsSet(Single): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private unsafe bool HasAllBitsSet(Single value) + { + for (int i = 0; i < sizeof(Single); i++) + { + if (((byte*)&value)[i] != 0xFF) + return false; + } + return true; + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.UInt16.cs new file mode 100644 index 00000000000000..6017fcbca5cced --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.UInt16.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AllBitsSetUInt16() + { + var test = new VectorAllBitsSet__AllBitsSetUInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAllBitsSet__AllBitsSetUInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.AllBitsSet; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.AllBitsSet), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + UInt16[] resultElements = new UInt16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private unsafe void ValidateResult(UInt16[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + for (var i = 0; i < ElementCount; i++) + { + if (!HasAllBitsSet(resultElements[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AllBitsSet(UInt16): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private unsafe bool HasAllBitsSet(UInt16 value) + { + for (int i = 0; i < sizeof(UInt16); i++) + { + if (((byte*)&value)[i] != 0xFF) + return false; + } + return true; + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.UInt32.cs new file mode 100644 index 00000000000000..78829a073832ab --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.UInt32.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AllBitsSetUInt32() + { + var test = new VectorAllBitsSet__AllBitsSetUInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAllBitsSet__AllBitsSetUInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.AllBitsSet; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.AllBitsSet), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + UInt32[] resultElements = new UInt32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private unsafe void ValidateResult(UInt32[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + for (var i = 0; i < ElementCount; i++) + { + if (!HasAllBitsSet(resultElements[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AllBitsSet(UInt32): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private unsafe bool HasAllBitsSet(UInt32 value) + { + for (int i = 0; i < sizeof(UInt32); i++) + { + if (((byte*)&value)[i] != 0xFF) + return false; + } + return true; + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.UInt64.cs new file mode 100644 index 00000000000000..cb48498470eeae --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AllBitsSet.UInt64.cs @@ -0,0 +1,107 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AllBitsSetUInt64() + { + var test = new VectorAllBitsSet__AllBitsSetUInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAllBitsSet__AllBitsSetUInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.AllBitsSet; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.AllBitsSet), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + UInt64[] resultElements = new UInt64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private unsafe void ValidateResult(UInt64[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + for (var i = 0; i < ElementCount; i++) + { + if (!HasAllBitsSet(resultElements[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AllBitsSet(UInt64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private unsafe bool HasAllBitsSet(UInt64 value) + { + for (int i = 0; i < sizeof(UInt64); i++) + { + if (((byte*)&value)[i] != 0xFF) + return false; + } + return true; + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Byte.cs new file mode 100644 index 00000000000000..e37bd2577f3c8a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Byte.cs @@ -0,0 +1,254 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsByte() + { + var test = new VectorAs__AsByte(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates basic functionality works using the generic form, rather than the type-specific form of the method + test.RunGenericScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsByte + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 byteResult = value.AsByte(); + ValidateResult(byteResult, value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 doubleResult = value.AsDouble(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 shortResult = value.AsInt16(); + ValidateResult(shortResult, value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 intResult = value.AsInt32(); + ValidateResult(intResult, value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 longResult = value.AsInt64(); + ValidateResult(longResult, value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 sbyteResult = value.AsSByte(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 floatResult = value.AsSingle(); + ValidateResult(floatResult, value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 ushortResult = value.AsUInt16(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 uintResult = value.AsUInt32(); + ValidateResult(uintResult, value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 ulongResult = value.AsUInt64(); + ValidateResult(ulongResult, value); + } + + public void RunGenericScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario)); + Vector512 value; + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 byteResult = value.As(); + ValidateResult(byteResult, value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 doubleResult = value.As(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 shortResult = value.As(); + ValidateResult(shortResult, value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 intResult = value.As(); + ValidateResult(intResult, value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 longResult = value.As(); + ValidateResult(longResult, value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 sbyteResult = value.As(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 floatResult = value.As(); + ValidateResult(floatResult, value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 ushortResult = value.As(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 uintResult = value.As(); + ValidateResult(uintResult, value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector512 ulongResult = value.As(); + ValidateResult(ulongResult, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + object byteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsByte)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(byteResult), value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + object doubleResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsDouble)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(doubleResult), value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + object shortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt16)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(shortResult), value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + object intResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt32)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(intResult), value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + object longResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt64)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(longResult), value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + object sbyteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSByte)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(sbyteResult), value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + object floatResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSingle)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(floatResult), value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + object ushortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt16)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ushortResult), value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + object uintResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt32)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(uintResult), value); + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + object ulongResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt64)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ulongResult), value); + } + + private void ValidateResult(Vector512 result, Vector512 value, [CallerMemberName] string method = "") + where T : struct + { + Byte[] resultElements = new Byte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + Byte[] valueElements = new Byte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, typeof(T), method); + } + + private void ValidateResult(Byte[] resultElements, Byte[] valueElements, Type targetType, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.As{targetType.Name}: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Double.cs new file mode 100644 index 00000000000000..cde35c21f30262 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Double.cs @@ -0,0 +1,254 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsDouble() + { + var test = new VectorAs__AsDouble(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates basic functionality works using the generic form, rather than the type-specific form of the method + test.RunGenericScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsDouble + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 byteResult = value.AsByte(); + ValidateResult(byteResult, value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 doubleResult = value.AsDouble(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 shortResult = value.AsInt16(); + ValidateResult(shortResult, value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 intResult = value.AsInt32(); + ValidateResult(intResult, value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 longResult = value.AsInt64(); + ValidateResult(longResult, value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 sbyteResult = value.AsSByte(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 floatResult = value.AsSingle(); + ValidateResult(floatResult, value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 ushortResult = value.AsUInt16(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 uintResult = value.AsUInt32(); + ValidateResult(uintResult, value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 ulongResult = value.AsUInt64(); + ValidateResult(ulongResult, value); + } + + public void RunGenericScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario)); + Vector512 value; + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 byteResult = value.As(); + ValidateResult(byteResult, value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 doubleResult = value.As(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 shortResult = value.As(); + ValidateResult(shortResult, value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 intResult = value.As(); + ValidateResult(intResult, value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 longResult = value.As(); + ValidateResult(longResult, value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 sbyteResult = value.As(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 floatResult = value.As(); + ValidateResult(floatResult, value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 ushortResult = value.As(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 uintResult = value.As(); + ValidateResult(uintResult, value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector512 ulongResult = value.As(); + ValidateResult(ulongResult, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + object byteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsByte)) + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(byteResult), value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + object doubleResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsDouble)) + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(doubleResult), value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + object shortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt16)) + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(shortResult), value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + object intResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt32)) + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(intResult), value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + object longResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt64)) + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(longResult), value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + object sbyteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSByte)) + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(sbyteResult), value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + object floatResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSingle)) + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(floatResult), value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + object ushortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt16)) + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ushortResult), value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + object uintResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt32)) + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(uintResult), value); + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + object ulongResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt64)) + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ulongResult), value); + } + + private void ValidateResult(Vector512 result, Vector512 value, [CallerMemberName] string method = "") + where T : struct + { + Double[] resultElements = new Double[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + Double[] valueElements = new Double[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, typeof(T), method); + } + + private void ValidateResult(Double[] resultElements, Double[] valueElements, Type targetType, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.As{targetType.Name}: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Int16.cs new file mode 100644 index 00000000000000..1445f526911cc2 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Int16.cs @@ -0,0 +1,254 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsInt16() + { + var test = new VectorAs__AsInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates basic functionality works using the generic form, rather than the type-specific form of the method + test.RunGenericScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 byteResult = value.AsByte(); + ValidateResult(byteResult, value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 doubleResult = value.AsDouble(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 shortResult = value.AsInt16(); + ValidateResult(shortResult, value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 intResult = value.AsInt32(); + ValidateResult(intResult, value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 longResult = value.AsInt64(); + ValidateResult(longResult, value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 sbyteResult = value.AsSByte(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 floatResult = value.AsSingle(); + ValidateResult(floatResult, value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 ushortResult = value.AsUInt16(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 uintResult = value.AsUInt32(); + ValidateResult(uintResult, value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 ulongResult = value.AsUInt64(); + ValidateResult(ulongResult, value); + } + + public void RunGenericScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario)); + Vector512 value; + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 byteResult = value.As(); + ValidateResult(byteResult, value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 doubleResult = value.As(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 shortResult = value.As(); + ValidateResult(shortResult, value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 intResult = value.As(); + ValidateResult(intResult, value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 longResult = value.As(); + ValidateResult(longResult, value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 sbyteResult = value.As(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 floatResult = value.As(); + ValidateResult(floatResult, value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 ushortResult = value.As(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 uintResult = value.As(); + ValidateResult(uintResult, value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector512 ulongResult = value.As(); + ValidateResult(ulongResult, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + object byteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsByte)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(byteResult), value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + object doubleResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsDouble)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(doubleResult), value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + object shortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt16)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(shortResult), value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + object intResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt32)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(intResult), value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + object longResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt64)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(longResult), value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + object sbyteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSByte)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(sbyteResult), value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + object floatResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSingle)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(floatResult), value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + object ushortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt16)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ushortResult), value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + object uintResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt32)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(uintResult), value); + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + object ulongResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt64)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ulongResult), value); + } + + private void ValidateResult(Vector512 result, Vector512 value, [CallerMemberName] string method = "") + where T : struct + { + Int16[] resultElements = new Int16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + Int16[] valueElements = new Int16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, typeof(T), method); + } + + private void ValidateResult(Int16[] resultElements, Int16[] valueElements, Type targetType, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.As{targetType.Name}: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Int32.cs new file mode 100644 index 00000000000000..cdf71841306513 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Int32.cs @@ -0,0 +1,254 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsInt32() + { + var test = new VectorAs__AsInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates basic functionality works using the generic form, rather than the type-specific form of the method + test.RunGenericScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 byteResult = value.AsByte(); + ValidateResult(byteResult, value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 doubleResult = value.AsDouble(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 shortResult = value.AsInt16(); + ValidateResult(shortResult, value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 intResult = value.AsInt32(); + ValidateResult(intResult, value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 longResult = value.AsInt64(); + ValidateResult(longResult, value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 sbyteResult = value.AsSByte(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 floatResult = value.AsSingle(); + ValidateResult(floatResult, value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 ushortResult = value.AsUInt16(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 uintResult = value.AsUInt32(); + ValidateResult(uintResult, value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 ulongResult = value.AsUInt64(); + ValidateResult(ulongResult, value); + } + + public void RunGenericScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario)); + Vector512 value; + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 byteResult = value.As(); + ValidateResult(byteResult, value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 doubleResult = value.As(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 shortResult = value.As(); + ValidateResult(shortResult, value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 intResult = value.As(); + ValidateResult(intResult, value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 longResult = value.As(); + ValidateResult(longResult, value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 sbyteResult = value.As(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 floatResult = value.As(); + ValidateResult(floatResult, value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 ushortResult = value.As(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 uintResult = value.As(); + ValidateResult(uintResult, value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector512 ulongResult = value.As(); + ValidateResult(ulongResult, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + object byteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsByte)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(byteResult), value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + object doubleResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsDouble)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(doubleResult), value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + object shortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt16)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(shortResult), value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + object intResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt32)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(intResult), value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + object longResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt64)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(longResult), value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + object sbyteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSByte)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(sbyteResult), value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + object floatResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSingle)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(floatResult), value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + object ushortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt16)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ushortResult), value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + object uintResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt32)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(uintResult), value); + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + object ulongResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt64)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ulongResult), value); + } + + private void ValidateResult(Vector512 result, Vector512 value, [CallerMemberName] string method = "") + where T : struct + { + Int32[] resultElements = new Int32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + Int32[] valueElements = new Int32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, typeof(T), method); + } + + private void ValidateResult(Int32[] resultElements, Int32[] valueElements, Type targetType, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.As{targetType.Name}: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Int64.cs new file mode 100644 index 00000000000000..0c38e9e3e4a976 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Int64.cs @@ -0,0 +1,254 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsInt64() + { + var test = new VectorAs__AsInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates basic functionality works using the generic form, rather than the type-specific form of the method + test.RunGenericScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 byteResult = value.AsByte(); + ValidateResult(byteResult, value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 doubleResult = value.AsDouble(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 shortResult = value.AsInt16(); + ValidateResult(shortResult, value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 intResult = value.AsInt32(); + ValidateResult(intResult, value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 longResult = value.AsInt64(); + ValidateResult(longResult, value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 sbyteResult = value.AsSByte(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 floatResult = value.AsSingle(); + ValidateResult(floatResult, value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 ushortResult = value.AsUInt16(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 uintResult = value.AsUInt32(); + ValidateResult(uintResult, value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 ulongResult = value.AsUInt64(); + ValidateResult(ulongResult, value); + } + + public void RunGenericScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario)); + Vector512 value; + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 byteResult = value.As(); + ValidateResult(byteResult, value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 doubleResult = value.As(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 shortResult = value.As(); + ValidateResult(shortResult, value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 intResult = value.As(); + ValidateResult(intResult, value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 longResult = value.As(); + ValidateResult(longResult, value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 sbyteResult = value.As(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 floatResult = value.As(); + ValidateResult(floatResult, value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 ushortResult = value.As(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 uintResult = value.As(); + ValidateResult(uintResult, value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector512 ulongResult = value.As(); + ValidateResult(ulongResult, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + object byteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsByte)) + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(byteResult), value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + object doubleResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsDouble)) + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(doubleResult), value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + object shortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt16)) + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(shortResult), value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + object intResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt32)) + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(intResult), value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + object longResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt64)) + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(longResult), value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + object sbyteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSByte)) + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(sbyteResult), value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + object floatResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSingle)) + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(floatResult), value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + object ushortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt16)) + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ushortResult), value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + object uintResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt32)) + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(uintResult), value); + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + object ulongResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt64)) + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ulongResult), value); + } + + private void ValidateResult(Vector512 result, Vector512 value, [CallerMemberName] string method = "") + where T : struct + { + Int64[] resultElements = new Int64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + Int64[] valueElements = new Int64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, typeof(T), method); + } + + private void ValidateResult(Int64[] resultElements, Int64[] valueElements, Type targetType, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.As{targetType.Name}: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.SByte.cs new file mode 100644 index 00000000000000..57f32b75f4292c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.SByte.cs @@ -0,0 +1,254 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsSByte() + { + var test = new VectorAs__AsSByte(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates basic functionality works using the generic form, rather than the type-specific form of the method + test.RunGenericScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsSByte + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 byteResult = value.AsByte(); + ValidateResult(byteResult, value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 doubleResult = value.AsDouble(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 shortResult = value.AsInt16(); + ValidateResult(shortResult, value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 intResult = value.AsInt32(); + ValidateResult(intResult, value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 longResult = value.AsInt64(); + ValidateResult(longResult, value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 sbyteResult = value.AsSByte(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 floatResult = value.AsSingle(); + ValidateResult(floatResult, value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 ushortResult = value.AsUInt16(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 uintResult = value.AsUInt32(); + ValidateResult(uintResult, value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 ulongResult = value.AsUInt64(); + ValidateResult(ulongResult, value); + } + + public void RunGenericScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario)); + Vector512 value; + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 byteResult = value.As(); + ValidateResult(byteResult, value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 doubleResult = value.As(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 shortResult = value.As(); + ValidateResult(shortResult, value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 intResult = value.As(); + ValidateResult(intResult, value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 longResult = value.As(); + ValidateResult(longResult, value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 sbyteResult = value.As(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 floatResult = value.As(); + ValidateResult(floatResult, value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 ushortResult = value.As(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 uintResult = value.As(); + ValidateResult(uintResult, value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector512 ulongResult = value.As(); + ValidateResult(ulongResult, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + object byteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsByte)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(byteResult), value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + object doubleResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsDouble)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(doubleResult), value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + object shortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt16)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(shortResult), value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + object intResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt32)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(intResult), value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + object longResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt64)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(longResult), value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + object sbyteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSByte)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(sbyteResult), value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + object floatResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSingle)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(floatResult), value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + object ushortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt16)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ushortResult), value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + object uintResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt32)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(uintResult), value); + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + object ulongResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt64)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ulongResult), value); + } + + private void ValidateResult(Vector512 result, Vector512 value, [CallerMemberName] string method = "") + where T : struct + { + SByte[] resultElements = new SByte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + SByte[] valueElements = new SByte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, typeof(T), method); + } + + private void ValidateResult(SByte[] resultElements, SByte[] valueElements, Type targetType, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.As{targetType.Name}: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Single.cs new file mode 100644 index 00000000000000..1ca8d28f5483d1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.Single.cs @@ -0,0 +1,254 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsSingle() + { + var test = new VectorAs__AsSingle(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates basic functionality works using the generic form, rather than the type-specific form of the method + test.RunGenericScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsSingle + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 byteResult = value.AsByte(); + ValidateResult(byteResult, value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 doubleResult = value.AsDouble(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 shortResult = value.AsInt16(); + ValidateResult(shortResult, value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 intResult = value.AsInt32(); + ValidateResult(intResult, value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 longResult = value.AsInt64(); + ValidateResult(longResult, value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 sbyteResult = value.AsSByte(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 floatResult = value.AsSingle(); + ValidateResult(floatResult, value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 ushortResult = value.AsUInt16(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 uintResult = value.AsUInt32(); + ValidateResult(uintResult, value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 ulongResult = value.AsUInt64(); + ValidateResult(ulongResult, value); + } + + public void RunGenericScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario)); + Vector512 value; + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 byteResult = value.As(); + ValidateResult(byteResult, value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 doubleResult = value.As(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 shortResult = value.As(); + ValidateResult(shortResult, value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 intResult = value.As(); + ValidateResult(intResult, value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 longResult = value.As(); + ValidateResult(longResult, value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 sbyteResult = value.As(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 floatResult = value.As(); + ValidateResult(floatResult, value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 ushortResult = value.As(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 uintResult = value.As(); + ValidateResult(uintResult, value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector512 ulongResult = value.As(); + ValidateResult(ulongResult, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + object byteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsByte)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(byteResult), value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + object doubleResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsDouble)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(doubleResult), value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + object shortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt16)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(shortResult), value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + object intResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt32)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(intResult), value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + object longResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt64)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(longResult), value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + object sbyteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSByte)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(sbyteResult), value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + object floatResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSingle)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(floatResult), value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + object ushortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt16)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ushortResult), value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + object uintResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt32)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(uintResult), value); + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + object ulongResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt64)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ulongResult), value); + } + + private void ValidateResult(Vector512 result, Vector512 value, [CallerMemberName] string method = "") + where T : struct + { + Single[] resultElements = new Single[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + Single[] valueElements = new Single[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, typeof(T), method); + } + + private void ValidateResult(Single[] resultElements, Single[] valueElements, Type targetType, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.As{targetType.Name}: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.UInt16.cs new file mode 100644 index 00000000000000..5a5a6d42541b20 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.UInt16.cs @@ -0,0 +1,254 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsUInt16() + { + var test = new VectorAs__AsUInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates basic functionality works using the generic form, rather than the type-specific form of the method + test.RunGenericScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsUInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 byteResult = value.AsByte(); + ValidateResult(byteResult, value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 doubleResult = value.AsDouble(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 shortResult = value.AsInt16(); + ValidateResult(shortResult, value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 intResult = value.AsInt32(); + ValidateResult(intResult, value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 longResult = value.AsInt64(); + ValidateResult(longResult, value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 sbyteResult = value.AsSByte(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 floatResult = value.AsSingle(); + ValidateResult(floatResult, value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 ushortResult = value.AsUInt16(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 uintResult = value.AsUInt32(); + ValidateResult(uintResult, value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 ulongResult = value.AsUInt64(); + ValidateResult(ulongResult, value); + } + + public void RunGenericScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario)); + Vector512 value; + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 byteResult = value.As(); + ValidateResult(byteResult, value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 doubleResult = value.As(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 shortResult = value.As(); + ValidateResult(shortResult, value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 intResult = value.As(); + ValidateResult(intResult, value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 longResult = value.As(); + ValidateResult(longResult, value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 sbyteResult = value.As(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 floatResult = value.As(); + ValidateResult(floatResult, value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 ushortResult = value.As(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 uintResult = value.As(); + ValidateResult(uintResult, value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector512 ulongResult = value.As(); + ValidateResult(ulongResult, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + object byteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsByte)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(byteResult), value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + object doubleResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsDouble)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(doubleResult), value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + object shortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt16)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(shortResult), value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + object intResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt32)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(intResult), value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + object longResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt64)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(longResult), value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + object sbyteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSByte)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(sbyteResult), value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + object floatResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSingle)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(floatResult), value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + object ushortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt16)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ushortResult), value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + object uintResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt32)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(uintResult), value); + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + object ulongResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt64)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ulongResult), value); + } + + private void ValidateResult(Vector512 result, Vector512 value, [CallerMemberName] string method = "") + where T : struct + { + UInt16[] resultElements = new UInt16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + UInt16[] valueElements = new UInt16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, typeof(T), method); + } + + private void ValidateResult(UInt16[] resultElements, UInt16[] valueElements, Type targetType, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.As{targetType.Name}: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.UInt32.cs new file mode 100644 index 00000000000000..467d91b5ab32a8 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.UInt32.cs @@ -0,0 +1,254 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsUInt32() + { + var test = new VectorAs__AsUInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates basic functionality works using the generic form, rather than the type-specific form of the method + test.RunGenericScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsUInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 byteResult = value.AsByte(); + ValidateResult(byteResult, value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 doubleResult = value.AsDouble(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 shortResult = value.AsInt16(); + ValidateResult(shortResult, value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 intResult = value.AsInt32(); + ValidateResult(intResult, value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 longResult = value.AsInt64(); + ValidateResult(longResult, value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 sbyteResult = value.AsSByte(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 floatResult = value.AsSingle(); + ValidateResult(floatResult, value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 ushortResult = value.AsUInt16(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 uintResult = value.AsUInt32(); + ValidateResult(uintResult, value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 ulongResult = value.AsUInt64(); + ValidateResult(ulongResult, value); + } + + public void RunGenericScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario)); + Vector512 value; + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 byteResult = value.As(); + ValidateResult(byteResult, value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 doubleResult = value.As(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 shortResult = value.As(); + ValidateResult(shortResult, value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 intResult = value.As(); + ValidateResult(intResult, value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 longResult = value.As(); + ValidateResult(longResult, value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 sbyteResult = value.As(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 floatResult = value.As(); + ValidateResult(floatResult, value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 ushortResult = value.As(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 uintResult = value.As(); + ValidateResult(uintResult, value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector512 ulongResult = value.As(); + ValidateResult(ulongResult, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + object byteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsByte)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(byteResult), value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + object doubleResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsDouble)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(doubleResult), value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + object shortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt16)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(shortResult), value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + object intResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt32)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(intResult), value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + object longResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt64)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(longResult), value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + object sbyteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSByte)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(sbyteResult), value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + object floatResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSingle)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(floatResult), value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + object ushortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt16)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ushortResult), value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + object uintResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt32)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(uintResult), value); + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + object ulongResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt64)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ulongResult), value); + } + + private void ValidateResult(Vector512 result, Vector512 value, [CallerMemberName] string method = "") + where T : struct + { + UInt32[] resultElements = new UInt32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + UInt32[] valueElements = new UInt32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, typeof(T), method); + } + + private void ValidateResult(UInt32[] resultElements, UInt32[] valueElements, Type targetType, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.As{targetType.Name}: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.UInt64.cs new file mode 100644 index 00000000000000..9fd140a3c56916 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/As.UInt64.cs @@ -0,0 +1,254 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsUInt64() + { + var test = new VectorAs__AsUInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates basic functionality works using the generic form, rather than the type-specific form of the method + test.RunGenericScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsUInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 byteResult = value.AsByte(); + ValidateResult(byteResult, value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 doubleResult = value.AsDouble(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 shortResult = value.AsInt16(); + ValidateResult(shortResult, value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 intResult = value.AsInt32(); + ValidateResult(intResult, value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 longResult = value.AsInt64(); + ValidateResult(longResult, value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 sbyteResult = value.AsSByte(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 floatResult = value.AsSingle(); + ValidateResult(floatResult, value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 ushortResult = value.AsUInt16(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 uintResult = value.AsUInt32(); + ValidateResult(uintResult, value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 ulongResult = value.AsUInt64(); + ValidateResult(ulongResult, value); + } + + public void RunGenericScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario)); + Vector512 value; + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 byteResult = value.As(); + ValidateResult(byteResult, value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 doubleResult = value.As(); + ValidateResult(doubleResult, value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 shortResult = value.As(); + ValidateResult(shortResult, value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 intResult = value.As(); + ValidateResult(intResult, value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 longResult = value.As(); + ValidateResult(longResult, value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 sbyteResult = value.As(); + ValidateResult(sbyteResult, value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 floatResult = value.As(); + ValidateResult(floatResult, value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 ushortResult = value.As(); + ValidateResult(ushortResult, value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 uintResult = value.As(); + ValidateResult(uintResult, value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector512 ulongResult = value.As(); + ValidateResult(ulongResult, value); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + object byteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsByte)) + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(byteResult), value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + object doubleResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsDouble)) + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(doubleResult), value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + object shortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt16)) + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(shortResult), value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + object intResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt32)) + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(intResult), value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + object longResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsInt64)) + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(longResult), value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + object sbyteResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSByte)) + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(sbyteResult), value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + object floatResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsSingle)) + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(floatResult), value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + object ushortResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt16)) + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ushortResult), value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + object uintResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt32)) + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(uintResult), value); + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + object ulongResult = typeof(Vector512) + .GetMethod(nameof(Vector512.AsUInt64)) + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector512)(ulongResult), value); + } + + private void ValidateResult(Vector512 result, Vector512 value, [CallerMemberName] string method = "") + where T : struct + { + UInt64[] resultElements = new UInt64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + UInt64[] valueElements = new UInt64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, typeof(T), method); + } + + private void ValidateResult(UInt64[] resultElements, UInt64[] valueElements, Type targetType, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.As{targetType.Name}: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Byte.cs new file mode 100644 index 00000000000000..4b9a96081c0955 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Byte.cs @@ -0,0 +1,163 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsVectorByte() + { + var test = new VectorAs__AsVectorByte(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsVectorByte + { + private static readonly int LargestVectorSize = 64; + + private static readonly int VectorElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static readonly int NumericsElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + Vector result = value.AsVector(); + ValidateResult(result, value); + + value = result.AsVector512(); + ValidateResult(value, result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((byte)TestLibrary.Generator.GetByte()); + object Result = typeof(Vector512) + .GetMethod(nameof(Vector512.AsVector)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector)(Result), value); + + value = (Vector512)typeof(Vector512) + .GetMethods() + .Where((methodInfo) => { + if (methodInfo.Name == nameof(Vector512.AsVector512)) + { + var parameters = methodInfo.GetParameters(); + return (parameters.Length == 1) && + (parameters[0].ParameterType.IsGenericType) && + (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>)); + } + return false; + }) + .Single() + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { Result }); + ValidateResult(value, (Vector)(Result)); + } + + private void ValidateResult(Vector result, Vector512 value, [CallerMemberName] string method = "") + { + Byte[] resultElements = new Byte[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + Byte[] valueElements = new Byte[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(Vector512 result, Vector value, [CallerMemberName] string method = "") + { + Byte[] resultElements = new Byte[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + Byte[] valueElements = new Byte[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(Byte[] resultElements, Byte[] valueElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements.Length <= valueElements.Length) + { + for (var i = 0; i < resultElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + } + else + { + for (var i = 0; i < valueElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + for (var i = valueElements.Length; i < resultElements.Length; i++) + { + if (resultElements[i] != default) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AsVector: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Double.cs new file mode 100644 index 00000000000000..00cda64dab9728 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Double.cs @@ -0,0 +1,163 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsVectorDouble() + { + var test = new VectorAs__AsVectorDouble(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsVectorDouble + { + private static readonly int LargestVectorSize = 64; + + private static readonly int VectorElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static readonly int NumericsElementCount = Unsafe.SizeOf>() / sizeof(Double); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + Vector result = value.AsVector(); + ValidateResult(result, value); + + value = result.AsVector512(); + ValidateResult(value, result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((double)TestLibrary.Generator.GetDouble()); + object Result = typeof(Vector512) + .GetMethod(nameof(Vector512.AsVector)) + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector)(Result), value); + + value = (Vector512)typeof(Vector512) + .GetMethods() + .Where((methodInfo) => { + if (methodInfo.Name == nameof(Vector512.AsVector512)) + { + var parameters = methodInfo.GetParameters(); + return (parameters.Length == 1) && + (parameters[0].ParameterType.IsGenericType) && + (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>)); + } + return false; + }) + .Single() + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { Result }); + ValidateResult(value, (Vector)(Result)); + } + + private void ValidateResult(Vector result, Vector512 value, [CallerMemberName] string method = "") + { + Double[] resultElements = new Double[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + Double[] valueElements = new Double[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(Vector512 result, Vector value, [CallerMemberName] string method = "") + { + Double[] resultElements = new Double[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + Double[] valueElements = new Double[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(Double[] resultElements, Double[] valueElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements.Length <= valueElements.Length) + { + for (var i = 0; i < resultElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + } + else + { + for (var i = 0; i < valueElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + for (var i = valueElements.Length; i < resultElements.Length; i++) + { + if (resultElements[i] != default) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AsVector: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Int16.cs new file mode 100644 index 00000000000000..a70938b128cd26 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Int16.cs @@ -0,0 +1,163 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsVectorInt16() + { + var test = new VectorAs__AsVectorInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsVectorInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int VectorElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static readonly int NumericsElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + Vector result = value.AsVector(); + ValidateResult(result, value); + + value = result.AsVector512(); + ValidateResult(value, result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((short)TestLibrary.Generator.GetInt16()); + object Result = typeof(Vector512) + .GetMethod(nameof(Vector512.AsVector)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector)(Result), value); + + value = (Vector512)typeof(Vector512) + .GetMethods() + .Where((methodInfo) => { + if (methodInfo.Name == nameof(Vector512.AsVector512)) + { + var parameters = methodInfo.GetParameters(); + return (parameters.Length == 1) && + (parameters[0].ParameterType.IsGenericType) && + (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>)); + } + return false; + }) + .Single() + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { Result }); + ValidateResult(value, (Vector)(Result)); + } + + private void ValidateResult(Vector result, Vector512 value, [CallerMemberName] string method = "") + { + Int16[] resultElements = new Int16[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + Int16[] valueElements = new Int16[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(Vector512 result, Vector value, [CallerMemberName] string method = "") + { + Int16[] resultElements = new Int16[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + Int16[] valueElements = new Int16[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(Int16[] resultElements, Int16[] valueElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements.Length <= valueElements.Length) + { + for (var i = 0; i < resultElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + } + else + { + for (var i = 0; i < valueElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + for (var i = valueElements.Length; i < resultElements.Length; i++) + { + if (resultElements[i] != default) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AsVector: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Int32.cs new file mode 100644 index 00000000000000..37a0f0a5afb75a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Int32.cs @@ -0,0 +1,163 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsVectorInt32() + { + var test = new VectorAs__AsVectorInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsVectorInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int VectorElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static readonly int NumericsElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + Vector result = value.AsVector(); + ValidateResult(result, value); + + value = result.AsVector512(); + ValidateResult(value, result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((int)TestLibrary.Generator.GetInt32()); + object Result = typeof(Vector512) + .GetMethod(nameof(Vector512.AsVector)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector)(Result), value); + + value = (Vector512)typeof(Vector512) + .GetMethods() + .Where((methodInfo) => { + if (methodInfo.Name == nameof(Vector512.AsVector512)) + { + var parameters = methodInfo.GetParameters(); + return (parameters.Length == 1) && + (parameters[0].ParameterType.IsGenericType) && + (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>)); + } + return false; + }) + .Single() + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { Result }); + ValidateResult(value, (Vector)(Result)); + } + + private void ValidateResult(Vector result, Vector512 value, [CallerMemberName] string method = "") + { + Int32[] resultElements = new Int32[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + Int32[] valueElements = new Int32[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(Vector512 result, Vector value, [CallerMemberName] string method = "") + { + Int32[] resultElements = new Int32[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + Int32[] valueElements = new Int32[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(Int32[] resultElements, Int32[] valueElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements.Length <= valueElements.Length) + { + for (var i = 0; i < resultElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + } + else + { + for (var i = 0; i < valueElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + for (var i = valueElements.Length; i < resultElements.Length; i++) + { + if (resultElements[i] != default) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AsVector: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Int64.cs new file mode 100644 index 00000000000000..14ffe98ca7bed3 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Int64.cs @@ -0,0 +1,163 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsVectorInt64() + { + var test = new VectorAs__AsVectorInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsVectorInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int VectorElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static readonly int NumericsElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + Vector result = value.AsVector(); + ValidateResult(result, value); + + value = result.AsVector512(); + ValidateResult(value, result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((long)TestLibrary.Generator.GetInt64()); + object Result = typeof(Vector512) + .GetMethod(nameof(Vector512.AsVector)) + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector)(Result), value); + + value = (Vector512)typeof(Vector512) + .GetMethods() + .Where((methodInfo) => { + if (methodInfo.Name == nameof(Vector512.AsVector512)) + { + var parameters = methodInfo.GetParameters(); + return (parameters.Length == 1) && + (parameters[0].ParameterType.IsGenericType) && + (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>)); + } + return false; + }) + .Single() + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { Result }); + ValidateResult(value, (Vector)(Result)); + } + + private void ValidateResult(Vector result, Vector512 value, [CallerMemberName] string method = "") + { + Int64[] resultElements = new Int64[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + Int64[] valueElements = new Int64[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(Vector512 result, Vector value, [CallerMemberName] string method = "") + { + Int64[] resultElements = new Int64[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + Int64[] valueElements = new Int64[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(Int64[] resultElements, Int64[] valueElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements.Length <= valueElements.Length) + { + for (var i = 0; i < resultElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + } + else + { + for (var i = 0; i < valueElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + for (var i = valueElements.Length; i < resultElements.Length; i++) + { + if (resultElements[i] != default) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AsVector: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.SByte.cs new file mode 100644 index 00000000000000..2107c2fb92e92a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.SByte.cs @@ -0,0 +1,163 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsVectorSByte() + { + var test = new VectorAs__AsVectorSByte(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsVectorSByte + { + private static readonly int LargestVectorSize = 64; + + private static readonly int VectorElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static readonly int NumericsElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + Vector result = value.AsVector(); + ValidateResult(result, value); + + value = result.AsVector512(); + ValidateResult(value, result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((sbyte)TestLibrary.Generator.GetSByte()); + object Result = typeof(Vector512) + .GetMethod(nameof(Vector512.AsVector)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector)(Result), value); + + value = (Vector512)typeof(Vector512) + .GetMethods() + .Where((methodInfo) => { + if (methodInfo.Name == nameof(Vector512.AsVector512)) + { + var parameters = methodInfo.GetParameters(); + return (parameters.Length == 1) && + (parameters[0].ParameterType.IsGenericType) && + (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>)); + } + return false; + }) + .Single() + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { Result }); + ValidateResult(value, (Vector)(Result)); + } + + private void ValidateResult(Vector result, Vector512 value, [CallerMemberName] string method = "") + { + SByte[] resultElements = new SByte[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + SByte[] valueElements = new SByte[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(Vector512 result, Vector value, [CallerMemberName] string method = "") + { + SByte[] resultElements = new SByte[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + SByte[] valueElements = new SByte[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(SByte[] resultElements, SByte[] valueElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements.Length <= valueElements.Length) + { + for (var i = 0; i < resultElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + } + else + { + for (var i = 0; i < valueElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + for (var i = valueElements.Length; i < resultElements.Length; i++) + { + if (resultElements[i] != default) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AsVector: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Single.cs new file mode 100644 index 00000000000000..8377ace181cea4 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.Single.cs @@ -0,0 +1,163 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsVectorSingle() + { + var test = new VectorAs__AsVectorSingle(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsVectorSingle + { + private static readonly int LargestVectorSize = 64; + + private static readonly int VectorElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static readonly int NumericsElementCount = Unsafe.SizeOf>() / sizeof(Single); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + Vector result = value.AsVector(); + ValidateResult(result, value); + + value = result.AsVector512(); + ValidateResult(value, result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((float)TestLibrary.Generator.GetSingle()); + object Result = typeof(Vector512) + .GetMethod(nameof(Vector512.AsVector)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector)(Result), value); + + value = (Vector512)typeof(Vector512) + .GetMethods() + .Where((methodInfo) => { + if (methodInfo.Name == nameof(Vector512.AsVector512)) + { + var parameters = methodInfo.GetParameters(); + return (parameters.Length == 1) && + (parameters[0].ParameterType.IsGenericType) && + (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>)); + } + return false; + }) + .Single() + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { Result }); + ValidateResult(value, (Vector)(Result)); + } + + private void ValidateResult(Vector result, Vector512 value, [CallerMemberName] string method = "") + { + Single[] resultElements = new Single[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + Single[] valueElements = new Single[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(Vector512 result, Vector value, [CallerMemberName] string method = "") + { + Single[] resultElements = new Single[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + Single[] valueElements = new Single[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(Single[] resultElements, Single[] valueElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements.Length <= valueElements.Length) + { + for (var i = 0; i < resultElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + } + else + { + for (var i = 0; i < valueElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + for (var i = valueElements.Length; i < resultElements.Length; i++) + { + if (resultElements[i] != default) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AsVector: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.UInt16.cs new file mode 100644 index 00000000000000..ca532e0840e2c8 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.UInt16.cs @@ -0,0 +1,163 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsVectorUInt16() + { + var test = new VectorAs__AsVectorUInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsVectorUInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int VectorElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static readonly int NumericsElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + Vector result = value.AsVector(); + ValidateResult(result, value); + + value = result.AsVector512(); + ValidateResult(value, result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((ushort)TestLibrary.Generator.GetUInt16()); + object Result = typeof(Vector512) + .GetMethod(nameof(Vector512.AsVector)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector)(Result), value); + + value = (Vector512)typeof(Vector512) + .GetMethods() + .Where((methodInfo) => { + if (methodInfo.Name == nameof(Vector512.AsVector512)) + { + var parameters = methodInfo.GetParameters(); + return (parameters.Length == 1) && + (parameters[0].ParameterType.IsGenericType) && + (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>)); + } + return false; + }) + .Single() + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { Result }); + ValidateResult(value, (Vector)(Result)); + } + + private void ValidateResult(Vector result, Vector512 value, [CallerMemberName] string method = "") + { + UInt16[] resultElements = new UInt16[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + UInt16[] valueElements = new UInt16[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(Vector512 result, Vector value, [CallerMemberName] string method = "") + { + UInt16[] resultElements = new UInt16[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + UInt16[] valueElements = new UInt16[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(UInt16[] resultElements, UInt16[] valueElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements.Length <= valueElements.Length) + { + for (var i = 0; i < resultElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + } + else + { + for (var i = 0; i < valueElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + for (var i = valueElements.Length; i < resultElements.Length; i++) + { + if (resultElements[i] != default) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AsVector: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.UInt32.cs new file mode 100644 index 00000000000000..4943b45e26c83b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.UInt32.cs @@ -0,0 +1,163 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsVectorUInt32() + { + var test = new VectorAs__AsVectorUInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsVectorUInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int VectorElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static readonly int NumericsElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + Vector result = value.AsVector(); + ValidateResult(result, value); + + value = result.AsVector512(); + ValidateResult(value, result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((uint)TestLibrary.Generator.GetUInt32()); + object Result = typeof(Vector512) + .GetMethod(nameof(Vector512.AsVector)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector)(Result), value); + + value = (Vector512)typeof(Vector512) + .GetMethods() + .Where((methodInfo) => { + if (methodInfo.Name == nameof(Vector512.AsVector512)) + { + var parameters = methodInfo.GetParameters(); + return (parameters.Length == 1) && + (parameters[0].ParameterType.IsGenericType) && + (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>)); + } + return false; + }) + .Single() + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { Result }); + ValidateResult(value, (Vector)(Result)); + } + + private void ValidateResult(Vector result, Vector512 value, [CallerMemberName] string method = "") + { + UInt32[] resultElements = new UInt32[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + UInt32[] valueElements = new UInt32[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(Vector512 result, Vector value, [CallerMemberName] string method = "") + { + UInt32[] resultElements = new UInt32[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + UInt32[] valueElements = new UInt32[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(UInt32[] resultElements, UInt32[] valueElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements.Length <= valueElements.Length) + { + for (var i = 0; i < resultElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + } + else + { + for (var i = 0; i < valueElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + for (var i = valueElements.Length; i < resultElements.Length; i++) + { + if (resultElements[i] != default) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AsVector: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.UInt64.cs new file mode 100644 index 00000000000000..48b620ab220c33 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/AsVector.UInt64.cs @@ -0,0 +1,163 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void AsVectorUInt64() + { + var test = new VectorAs__AsVectorUInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorAs__AsVectorUInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int VectorElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static readonly int NumericsElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + Vector512 value; + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + Vector result = value.AsVector(); + ValidateResult(result, value); + + value = result.AsVector512(); + ValidateResult(value, result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + Vector512 value; + + value = Vector512.Create((ulong)TestLibrary.Generator.GetUInt64()); + object Result = typeof(Vector512) + .GetMethod(nameof(Vector512.AsVector)) + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { value }); + ValidateResult((Vector)(Result), value); + + value = (Vector512)typeof(Vector512) + .GetMethods() + .Where((methodInfo) => { + if (methodInfo.Name == nameof(Vector512.AsVector512)) + { + var parameters = methodInfo.GetParameters(); + return (parameters.Length == 1) && + (parameters[0].ParameterType.IsGenericType) && + (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>)); + } + return false; + }) + .Single() + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { Result }); + ValidateResult(value, (Vector)(Result)); + } + + private void ValidateResult(Vector result, Vector512 value, [CallerMemberName] string method = "") + { + UInt64[] resultElements = new UInt64[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + UInt64[] valueElements = new UInt64[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(Vector512 result, Vector value, [CallerMemberName] string method = "") + { + UInt64[] resultElements = new UInt64[VectorElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + + UInt64[] valueElements = new UInt64[NumericsElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref valueElements[0]), value); + + ValidateResult(resultElements, valueElements, method); + } + + private void ValidateResult(UInt64[] resultElements, UInt64[] valueElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (resultElements.Length <= valueElements.Length) + { + for (var i = 0; i < resultElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + } + else + { + for (var i = 0; i < valueElements.Length; i++) + { + if (resultElements[i] != valueElements[i]) + { + succeeded = false; + break; + } + } + + for (var i = valueElements.Length; i < resultElements.Length; i++) + { + if (resultElements[i] != default) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.AsVector: {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", valueElements)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.0.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.0.cs new file mode 100644 index 00000000000000..38744365a94d96 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.0.cs @@ -0,0 +1,230 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void GetAndWithElementByte0() + { + var test = new VectorGetAndWithElement__GetAndWithElementByte0(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + // Validates that invalid indices throws ArgumentOutOfRangeException + test.RunArgumentOutOfRangeScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorGetAndWithElement__GetAndWithElementByte0 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Byte[] values = new Byte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetByte(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Byte result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Byte)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Byte[] values, Byte insertedValue, [CallerMemberName] string method = "") + { + Byte[] resultElements = new Byte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Byte[] result, Byte[] values, Byte insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 0) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[0] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Byte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 15, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Byte[] values = new Byte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetByte(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Byte result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Byte)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Byte[] values, Byte insertedValue, [CallerMemberName] string method = "") + { + Byte[] resultElements = new Byte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Byte[] result, Byte[] values, Byte insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 15) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[15] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Byte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 31, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Byte[] values = new Byte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetByte(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Byte result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Byte)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Byte[] values, Byte insertedValue, [CallerMemberName] string method = "") + { + Byte[] resultElements = new Byte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Byte[] result, Byte[] values, Byte insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 31) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[31] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Byte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 7, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Byte[] values = new Byte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetByte(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Byte result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Byte)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Byte[] values, Byte insertedValue, [CallerMemberName] string method = "") + { + Byte[] resultElements = new Byte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Byte[] result, Byte[] values, Byte insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 7) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[7] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Double); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Double[] values = new Double[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetDouble(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Double result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Double)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Double[] values, Double insertedValue, [CallerMemberName] string method = "") + { + Double[] resultElements = new Double[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Double[] result, Double[] values, Double insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 0) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[0] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Double); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 1, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Double[] values = new Double[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetDouble(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Double result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Double)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Double[] values, Double insertedValue, [CallerMemberName] string method = "") + { + Double[] resultElements = new Double[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Double[] result, Double[] values, Double insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 1) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[1] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Double); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 3, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Double[] values = new Double[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetDouble(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Double result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Double)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Double[] values, Double insertedValue, [CallerMemberName] string method = "") + { + Double[] resultElements = new Double[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Double[] result, Double[] values, Double insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 3) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[3] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Int16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int16[] values = new Int16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt16(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Int16 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Int16)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Int16[] values, Int16 insertedValue, [CallerMemberName] string method = "") + { + Int16[] resultElements = new Int16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Int16[] result, Int16[] values, Int16 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 0) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[0] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Int16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 15, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int16[] values = new Int16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt16(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Int16 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Int16)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Int16[] values, Int16 insertedValue, [CallerMemberName] string method = "") + { + Int16[] resultElements = new Int16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Int16[] result, Int16[] values, Int16 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 15) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[15] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Int16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 3, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int16[] values = new Int16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt16(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Int16 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Int16)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Int16[] values, Int16 insertedValue, [CallerMemberName] string method = "") + { + Int16[] resultElements = new Int16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Int16[] result, Int16[] values, Int16 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 3) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[3] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Int16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 7, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int16[] values = new Int16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt16(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Int16 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Int16)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Int16[] values, Int16 insertedValue, [CallerMemberName] string method = "") + { + Int16[] resultElements = new Int16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Int16[] result, Int16[] values, Int16 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 7) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[7] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Int32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int32[] values = new Int32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt32(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Int32 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Int32)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Int32[] values, Int32 insertedValue, [CallerMemberName] string method = "") + { + Int32[] resultElements = new Int32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Int32[] result, Int32[] values, Int32 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 0) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[0] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Int32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 1, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int32[] values = new Int32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt32(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Int32 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Int32)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Int32[] values, Int32 insertedValue, [CallerMemberName] string method = "") + { + Int32[] resultElements = new Int32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Int32[] result, Int32[] values, Int32 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 1) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[1] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Int32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 3, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int32[] values = new Int32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt32(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Int32 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Int32)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Int32[] values, Int32 insertedValue, [CallerMemberName] string method = "") + { + Int32[] resultElements = new Int32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Int32[] result, Int32[] values, Int32 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 3) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[3] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Int32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 7, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int32[] values = new Int32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt32(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Int32 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Int32)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Int32[] values, Int32 insertedValue, [CallerMemberName] string method = "") + { + Int32[] resultElements = new Int32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Int32[] result, Int32[] values, Int32 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 7) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[7] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Int64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int64[] values = new Int64[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt64(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Int64 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Int64)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Int64[] values, Int64 insertedValue, [CallerMemberName] string method = "") + { + Int64[] resultElements = new Int64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Int64[] result, Int64[] values, Int64 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 0) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[0] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Int64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 1, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int64[] values = new Int64[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt64(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Int64 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Int64)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Int64[] values, Int64 insertedValue, [CallerMemberName] string method = "") + { + Int64[] resultElements = new Int64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Int64[] result, Int64[] values, Int64 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 1) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[1] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Int64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 3, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int64[] values = new Int64[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt64(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Int64 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Int64)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Int64[] values, Int64 insertedValue, [CallerMemberName] string method = "") + { + Int64[] resultElements = new Int64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Int64[] result, Int64[] values, Int64 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 3) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[3] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(SByte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + SByte[] values = new SByte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetSByte(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + SByte result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((SByte)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, SByte[] values, SByte insertedValue, [CallerMemberName] string method = "") + { + SByte[] resultElements = new SByte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(SByte[] result, SByte[] values, SByte insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 0) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[0] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(SByte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 15, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + SByte[] values = new SByte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetSByte(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + SByte result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((SByte)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, SByte[] values, SByte insertedValue, [CallerMemberName] string method = "") + { + SByte[] resultElements = new SByte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(SByte[] result, SByte[] values, SByte insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 15) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[15] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(SByte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 31, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + SByte[] values = new SByte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetSByte(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + SByte result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((SByte)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, SByte[] values, SByte insertedValue, [CallerMemberName] string method = "") + { + SByte[] resultElements = new SByte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(SByte[] result, SByte[] values, SByte insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 31) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[31] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(SByte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 7, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + SByte[] values = new SByte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetSByte(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + SByte result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((SByte)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, SByte[] values, SByte insertedValue, [CallerMemberName] string method = "") + { + SByte[] resultElements = new SByte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(SByte[] result, SByte[] values, SByte insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 7) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[7] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Single); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Single[] values = new Single[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetSingle(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Single result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Single)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Single[] values, Single insertedValue, [CallerMemberName] string method = "") + { + Single[] resultElements = new Single[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Single[] result, Single[] values, Single insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 0) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[0] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Single); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 1, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Single[] values = new Single[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetSingle(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Single result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Single)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Single[] values, Single insertedValue, [CallerMemberName] string method = "") + { + Single[] resultElements = new Single[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Single[] result, Single[] values, Single insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 1) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[1] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Single); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 3, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Single[] values = new Single[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetSingle(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Single result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Single)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Single[] values, Single insertedValue, [CallerMemberName] string method = "") + { + Single[] resultElements = new Single[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Single[] result, Single[] values, Single insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 3) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[3] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Single); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 7, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Single[] values = new Single[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetSingle(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + Single result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((Single)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, Single[] values, Single insertedValue, [CallerMemberName] string method = "") + { + Single[] resultElements = new Single[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(Single[] result, Single[] values, Single insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 7) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[7] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(UInt16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt16[] values = new UInt16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt16(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + UInt16 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((UInt16)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, UInt16[] values, UInt16 insertedValue, [CallerMemberName] string method = "") + { + UInt16[] resultElements = new UInt16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(UInt16[] result, UInt16[] values, UInt16 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 0) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[0] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(UInt16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 15, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt16[] values = new UInt16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt16(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + UInt16 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((UInt16)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, UInt16[] values, UInt16 insertedValue, [CallerMemberName] string method = "") + { + UInt16[] resultElements = new UInt16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(UInt16[] result, UInt16[] values, UInt16 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 15) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[15] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(UInt16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 3, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt16[] values = new UInt16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt16(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + UInt16 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((UInt16)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, UInt16[] values, UInt16 insertedValue, [CallerMemberName] string method = "") + { + UInt16[] resultElements = new UInt16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(UInt16[] result, UInt16[] values, UInt16 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 3) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[3] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(UInt16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 7, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt16[] values = new UInt16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt16(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + UInt16 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((UInt16)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, UInt16[] values, UInt16 insertedValue, [CallerMemberName] string method = "") + { + UInt16[] resultElements = new UInt16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(UInt16[] result, UInt16[] values, UInt16 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 7) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[7] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(UInt32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt32[] values = new UInt32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt32(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + UInt32 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((UInt32)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, UInt32[] values, UInt32 insertedValue, [CallerMemberName] string method = "") + { + UInt32[] resultElements = new UInt32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(UInt32[] result, UInt32[] values, UInt32 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 0) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[0] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(UInt32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 1, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt32[] values = new UInt32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt32(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + UInt32 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((UInt32)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, UInt32[] values, UInt32 insertedValue, [CallerMemberName] string method = "") + { + UInt32[] resultElements = new UInt32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(UInt32[] result, UInt32[] values, UInt32 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 1) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[1] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(UInt32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 3, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt32[] values = new UInt32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt32(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + UInt32 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((UInt32)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, UInt32[] values, UInt32 insertedValue, [CallerMemberName] string method = "") + { + UInt32[] resultElements = new UInt32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(UInt32[] result, UInt32[] values, UInt32 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 3) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[3] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(UInt32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 7, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt32[] values = new UInt32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt32(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + UInt32 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((UInt32)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, UInt32[] values, UInt32 insertedValue, [CallerMemberName] string method = "") + { + UInt32[] resultElements = new UInt32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(UInt32[] result, UInt32[] values, UInt32 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 7) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[7] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(UInt64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt64[] values = new UInt64[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt64(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + UInt64 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((UInt64)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, UInt64[] values, UInt64 insertedValue, [CallerMemberName] string method = "") + { + UInt64[] resultElements = new UInt64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(UInt64[] result, UInt64[] values, UInt64 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 0) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[0] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(UInt64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 1, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt64[] values = new UInt64[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt64(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + UInt64 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((UInt64)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, UInt64[] values, UInt64 insertedValue, [CallerMemberName] string method = "") + { + UInt64[] resultElements = new UInt64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(UInt64[] result, UInt64[] values, UInt64 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 1) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[1] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(UInt64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario(int imm = 3, bool expectedOutOfRangeException = false) + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt64[] values = new UInt64[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt64(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + UInt64 result = value.GetElement(imm); + ValidateGetResult(result, values); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result2 = value.WithElement(imm, insertedValue); + ValidateWithResult(result2, values, insertedValue); + } + catch (ArgumentOutOfRangeException) + { + succeeded = expectedOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + bool succeeded = !expectedOutOfRangeException; + + try + { + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.GetElement)) + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { value, imm }); + ValidateGetResult((UInt64)(result), values); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512)(result2), values, insertedValue); + } + catch (TargetInvocationException e) + { + succeeded = expectedOutOfRangeException + && e.InnerException is ArgumentOutOfRangeException; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512 result, UInt64[] values, UInt64 insertedValue, [CallerMemberName] string method = "") + { + UInt64[] resultElements = new UInt64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, insertedValue, method); + } + + private void ValidateWithResult(UInt64[] result, UInt64[] values, UInt64 insertedValue, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount; i++) + { + if ((i != 3) && (result[i] != values[i])) + { + succeeded = false; + break; + } + } + + if (result[3] != insertedValue) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Byte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Byte[] values = new Byte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetByte(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + Vector256 lowerResult = value.GetLower(); + Vector256 upperResult = value.GetUpper(); + ValidateGetResult(lowerResult, upperResult, values); + + Vector512 result = value.WithLower(upperResult); + result = result.WithUpper(lowerResult); + ValidateWithResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Byte[] values = new Byte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetByte(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + object lowerResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetLower)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { value }); + object upperResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetUpper)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { value }); + ValidateGetResult((Vector256)(lowerResult), (Vector256)(upperResult), values); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithLower)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { value, upperResult }); + result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithUpper)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { result, lowerResult }); + ValidateWithResult((Vector512)(result), values); + } + + private void ValidateGetResult(Vector256 lowerResult, Vector256 upperResult, Byte[] values, [CallerMemberName] string method = "") + { + Byte[] lowerElements = new Byte[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref lowerElements[0]), lowerResult); + + Byte[] upperElements = new Byte[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref upperElements[0]), upperResult); + + ValidateGetResult(lowerElements, upperElements, values, method); + } + + private void ValidateGetResult(Byte[] lowerResult, Byte[] upperResult, Byte[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (lowerResult[i] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetLower(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", lowerResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + + succeeded = true; + + for (int i = ElementCount / 2; i < ElementCount; i++) + { + if (upperResult[i - (ElementCount / 2)] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetUpper(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", upperResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private void ValidateWithResult(Vector512 result, Byte[] values, [CallerMemberName] string method = "") + { + Byte[] resultElements = new Byte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, method); + } + + private void ValidateWithResult(Byte[] result, Byte[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (result[i] != values[i + (ElementCount / 2)]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Double); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Double[] values = new Double[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetDouble(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + Vector256 lowerResult = value.GetLower(); + Vector256 upperResult = value.GetUpper(); + ValidateGetResult(lowerResult, upperResult, values); + + Vector512 result = value.WithLower(upperResult); + result = result.WithUpper(lowerResult); + ValidateWithResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Double[] values = new Double[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetDouble(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + object lowerResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetLower)) + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { value }); + object upperResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetUpper)) + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { value }); + ValidateGetResult((Vector256)(lowerResult), (Vector256)(upperResult), values); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithLower)) + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { value, upperResult }); + result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithUpper)) + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { result, lowerResult }); + ValidateWithResult((Vector512)(result), values); + } + + private void ValidateGetResult(Vector256 lowerResult, Vector256 upperResult, Double[] values, [CallerMemberName] string method = "") + { + Double[] lowerElements = new Double[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref lowerElements[0]), lowerResult); + + Double[] upperElements = new Double[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref upperElements[0]), upperResult); + + ValidateGetResult(lowerElements, upperElements, values, method); + } + + private void ValidateGetResult(Double[] lowerResult, Double[] upperResult, Double[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (lowerResult[i] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetLower(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", lowerResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + + succeeded = true; + + for (int i = ElementCount / 2; i < ElementCount; i++) + { + if (upperResult[i - (ElementCount / 2)] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetUpper(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", upperResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private void ValidateWithResult(Vector512 result, Double[] values, [CallerMemberName] string method = "") + { + Double[] resultElements = new Double[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, method); + } + + private void ValidateWithResult(Double[] result, Double[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (result[i] != values[i + (ElementCount / 2)]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Int16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int16[] values = new Int16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt16(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + Vector256 lowerResult = value.GetLower(); + Vector256 upperResult = value.GetUpper(); + ValidateGetResult(lowerResult, upperResult, values); + + Vector512 result = value.WithLower(upperResult); + result = result.WithUpper(lowerResult); + ValidateWithResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Int16[] values = new Int16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt16(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + object lowerResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetLower)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { value }); + object upperResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetUpper)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { value }); + ValidateGetResult((Vector256)(lowerResult), (Vector256)(upperResult), values); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithLower)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { value, upperResult }); + result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithUpper)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { result, lowerResult }); + ValidateWithResult((Vector512)(result), values); + } + + private void ValidateGetResult(Vector256 lowerResult, Vector256 upperResult, Int16[] values, [CallerMemberName] string method = "") + { + Int16[] lowerElements = new Int16[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref lowerElements[0]), lowerResult); + + Int16[] upperElements = new Int16[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref upperElements[0]), upperResult); + + ValidateGetResult(lowerElements, upperElements, values, method); + } + + private void ValidateGetResult(Int16[] lowerResult, Int16[] upperResult, Int16[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (lowerResult[i] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetLower(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", lowerResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + + succeeded = true; + + for (int i = ElementCount / 2; i < ElementCount; i++) + { + if (upperResult[i - (ElementCount / 2)] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetUpper(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", upperResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private void ValidateWithResult(Vector512 result, Int16[] values, [CallerMemberName] string method = "") + { + Int16[] resultElements = new Int16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, method); + } + + private void ValidateWithResult(Int16[] result, Int16[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (result[i] != values[i + (ElementCount / 2)]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Int32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int32[] values = new Int32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt32(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + Vector256 lowerResult = value.GetLower(); + Vector256 upperResult = value.GetUpper(); + ValidateGetResult(lowerResult, upperResult, values); + + Vector512 result = value.WithLower(upperResult); + result = result.WithUpper(lowerResult); + ValidateWithResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Int32[] values = new Int32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt32(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + object lowerResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetLower)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { value }); + object upperResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetUpper)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { value }); + ValidateGetResult((Vector256)(lowerResult), (Vector256)(upperResult), values); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithLower)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { value, upperResult }); + result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithUpper)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { result, lowerResult }); + ValidateWithResult((Vector512)(result), values); + } + + private void ValidateGetResult(Vector256 lowerResult, Vector256 upperResult, Int32[] values, [CallerMemberName] string method = "") + { + Int32[] lowerElements = new Int32[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref lowerElements[0]), lowerResult); + + Int32[] upperElements = new Int32[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref upperElements[0]), upperResult); + + ValidateGetResult(lowerElements, upperElements, values, method); + } + + private void ValidateGetResult(Int32[] lowerResult, Int32[] upperResult, Int32[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (lowerResult[i] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetLower(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", lowerResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + + succeeded = true; + + for (int i = ElementCount / 2; i < ElementCount; i++) + { + if (upperResult[i - (ElementCount / 2)] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetUpper(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", upperResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private void ValidateWithResult(Vector512 result, Int32[] values, [CallerMemberName] string method = "") + { + Int32[] resultElements = new Int32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, method); + } + + private void ValidateWithResult(Int32[] result, Int32[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (result[i] != values[i + (ElementCount / 2)]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Int64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int64[] values = new Int64[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt64(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + Vector256 lowerResult = value.GetLower(); + Vector256 upperResult = value.GetUpper(); + ValidateGetResult(lowerResult, upperResult, values); + + Vector512 result = value.WithLower(upperResult); + result = result.WithUpper(lowerResult); + ValidateWithResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Int64[] values = new Int64[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt64(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + object lowerResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetLower)) + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { value }); + object upperResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetUpper)) + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { value }); + ValidateGetResult((Vector256)(lowerResult), (Vector256)(upperResult), values); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithLower)) + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { value, upperResult }); + result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithUpper)) + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { result, lowerResult }); + ValidateWithResult((Vector512)(result), values); + } + + private void ValidateGetResult(Vector256 lowerResult, Vector256 upperResult, Int64[] values, [CallerMemberName] string method = "") + { + Int64[] lowerElements = new Int64[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref lowerElements[0]), lowerResult); + + Int64[] upperElements = new Int64[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref upperElements[0]), upperResult); + + ValidateGetResult(lowerElements, upperElements, values, method); + } + + private void ValidateGetResult(Int64[] lowerResult, Int64[] upperResult, Int64[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (lowerResult[i] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetLower(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", lowerResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + + succeeded = true; + + for (int i = ElementCount / 2; i < ElementCount; i++) + { + if (upperResult[i - (ElementCount / 2)] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetUpper(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", upperResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private void ValidateWithResult(Vector512 result, Int64[] values, [CallerMemberName] string method = "") + { + Int64[] resultElements = new Int64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, method); + } + + private void ValidateWithResult(Int64[] result, Int64[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (result[i] != values[i + (ElementCount / 2)]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(SByte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + SByte[] values = new SByte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetSByte(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + Vector256 lowerResult = value.GetLower(); + Vector256 upperResult = value.GetUpper(); + ValidateGetResult(lowerResult, upperResult, values); + + Vector512 result = value.WithLower(upperResult); + result = result.WithUpper(lowerResult); + ValidateWithResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + SByte[] values = new SByte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetSByte(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + object lowerResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetLower)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { value }); + object upperResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetUpper)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { value }); + ValidateGetResult((Vector256)(lowerResult), (Vector256)(upperResult), values); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithLower)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { value, upperResult }); + result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithUpper)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { result, lowerResult }); + ValidateWithResult((Vector512)(result), values); + } + + private void ValidateGetResult(Vector256 lowerResult, Vector256 upperResult, SByte[] values, [CallerMemberName] string method = "") + { + SByte[] lowerElements = new SByte[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref lowerElements[0]), lowerResult); + + SByte[] upperElements = new SByte[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref upperElements[0]), upperResult); + + ValidateGetResult(lowerElements, upperElements, values, method); + } + + private void ValidateGetResult(SByte[] lowerResult, SByte[] upperResult, SByte[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (lowerResult[i] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetLower(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", lowerResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + + succeeded = true; + + for (int i = ElementCount / 2; i < ElementCount; i++) + { + if (upperResult[i - (ElementCount / 2)] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetUpper(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", upperResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private void ValidateWithResult(Vector512 result, SByte[] values, [CallerMemberName] string method = "") + { + SByte[] resultElements = new SByte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, method); + } + + private void ValidateWithResult(SByte[] result, SByte[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (result[i] != values[i + (ElementCount / 2)]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Single); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Single[] values = new Single[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetSingle(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + Vector256 lowerResult = value.GetLower(); + Vector256 upperResult = value.GetUpper(); + ValidateGetResult(lowerResult, upperResult, values); + + Vector512 result = value.WithLower(upperResult); + result = result.WithUpper(lowerResult); + ValidateWithResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Single[] values = new Single[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetSingle(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + object lowerResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetLower)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { value }); + object upperResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetUpper)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { value }); + ValidateGetResult((Vector256)(lowerResult), (Vector256)(upperResult), values); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithLower)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { value, upperResult }); + result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithUpper)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { result, lowerResult }); + ValidateWithResult((Vector512)(result), values); + } + + private void ValidateGetResult(Vector256 lowerResult, Vector256 upperResult, Single[] values, [CallerMemberName] string method = "") + { + Single[] lowerElements = new Single[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref lowerElements[0]), lowerResult); + + Single[] upperElements = new Single[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref upperElements[0]), upperResult); + + ValidateGetResult(lowerElements, upperElements, values, method); + } + + private void ValidateGetResult(Single[] lowerResult, Single[] upperResult, Single[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (lowerResult[i] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetLower(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", lowerResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + + succeeded = true; + + for (int i = ElementCount / 2; i < ElementCount; i++) + { + if (upperResult[i - (ElementCount / 2)] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetUpper(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", upperResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private void ValidateWithResult(Vector512 result, Single[] values, [CallerMemberName] string method = "") + { + Single[] resultElements = new Single[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, method); + } + + private void ValidateWithResult(Single[] result, Single[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (result[i] != values[i + (ElementCount / 2)]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(UInt16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt16[] values = new UInt16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt16(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + Vector256 lowerResult = value.GetLower(); + Vector256 upperResult = value.GetUpper(); + ValidateGetResult(lowerResult, upperResult, values); + + Vector512 result = value.WithLower(upperResult); + result = result.WithUpper(lowerResult); + ValidateWithResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + UInt16[] values = new UInt16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt16(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + object lowerResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetLower)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { value }); + object upperResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetUpper)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { value }); + ValidateGetResult((Vector256)(lowerResult), (Vector256)(upperResult), values); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithLower)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { value, upperResult }); + result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithUpper)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { result, lowerResult }); + ValidateWithResult((Vector512)(result), values); + } + + private void ValidateGetResult(Vector256 lowerResult, Vector256 upperResult, UInt16[] values, [CallerMemberName] string method = "") + { + UInt16[] lowerElements = new UInt16[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref lowerElements[0]), lowerResult); + + UInt16[] upperElements = new UInt16[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref upperElements[0]), upperResult); + + ValidateGetResult(lowerElements, upperElements, values, method); + } + + private void ValidateGetResult(UInt16[] lowerResult, UInt16[] upperResult, UInt16[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (lowerResult[i] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetLower(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", lowerResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + + succeeded = true; + + for (int i = ElementCount / 2; i < ElementCount; i++) + { + if (upperResult[i - (ElementCount / 2)] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetUpper(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", upperResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private void ValidateWithResult(Vector512 result, UInt16[] values, [CallerMemberName] string method = "") + { + UInt16[] resultElements = new UInt16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, method); + } + + private void ValidateWithResult(UInt16[] result, UInt16[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (result[i] != values[i + (ElementCount / 2)]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(UInt32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt32[] values = new UInt32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt32(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + Vector256 lowerResult = value.GetLower(); + Vector256 upperResult = value.GetUpper(); + ValidateGetResult(lowerResult, upperResult, values); + + Vector512 result = value.WithLower(upperResult); + result = result.WithUpper(lowerResult); + ValidateWithResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + UInt32[] values = new UInt32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt32(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + object lowerResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetLower)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { value }); + object upperResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetUpper)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { value }); + ValidateGetResult((Vector256)(lowerResult), (Vector256)(upperResult), values); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithLower)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { value, upperResult }); + result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithUpper)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { result, lowerResult }); + ValidateWithResult((Vector512)(result), values); + } + + private void ValidateGetResult(Vector256 lowerResult, Vector256 upperResult, UInt32[] values, [CallerMemberName] string method = "") + { + UInt32[] lowerElements = new UInt32[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref lowerElements[0]), lowerResult); + + UInt32[] upperElements = new UInt32[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref upperElements[0]), upperResult); + + ValidateGetResult(lowerElements, upperElements, values, method); + } + + private void ValidateGetResult(UInt32[] lowerResult, UInt32[] upperResult, UInt32[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (lowerResult[i] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetLower(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", lowerResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + + succeeded = true; + + for (int i = ElementCount / 2; i < ElementCount; i++) + { + if (upperResult[i - (ElementCount / 2)] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetUpper(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", upperResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private void ValidateWithResult(Vector512 result, UInt32[] values, [CallerMemberName] string method = "") + { + UInt32[] resultElements = new UInt32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, method); + } + + private void ValidateWithResult(UInt32[] result, UInt32[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (result[i] != values[i + (ElementCount / 2)]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(UInt64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt64[] values = new UInt64[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt64(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + Vector256 lowerResult = value.GetLower(); + Vector256 upperResult = value.GetUpper(); + ValidateGetResult(lowerResult, upperResult, values); + + Vector512 result = value.WithLower(upperResult); + result = result.WithUpper(lowerResult); + ValidateWithResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + UInt64[] values = new UInt64[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt64(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + object lowerResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetLower)) + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { value }); + object upperResult = typeof(Vector512) + .GetMethod(nameof(Vector512.GetUpper)) + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { value }); + ValidateGetResult((Vector256)(lowerResult), (Vector256)(upperResult), values); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithLower)) + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { value, upperResult }); + result = typeof(Vector512) + .GetMethod(nameof(Vector512.WithUpper)) + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { result, lowerResult }); + ValidateWithResult((Vector512)(result), values); + } + + private void ValidateGetResult(Vector256 lowerResult, Vector256 upperResult, UInt64[] values, [CallerMemberName] string method = "") + { + UInt64[] lowerElements = new UInt64[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref lowerElements[0]), lowerResult); + + UInt64[] upperElements = new UInt64[ElementCount / 2]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref upperElements[0]), upperResult); + + ValidateGetResult(lowerElements, upperElements, values, method); + } + + private void ValidateGetResult(UInt64[] lowerResult, UInt64[] upperResult, UInt64[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (lowerResult[i] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetLower(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", lowerResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + + succeeded = true; + + for (int i = ElementCount / 2; i < ElementCount; i++) + { + if (upperResult[i - (ElementCount / 2)] != values[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.GetUpper(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", upperResult)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private void ValidateWithResult(Vector512 result, UInt64[] values, [CallerMemberName] string method = "") + { + UInt64[] resultElements = new UInt64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateWithResult(resultElements, values, method); + } + + private void ValidateWithResult(UInt64[] result, UInt64[] values, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < ElementCount / 2; i++) + { + if (result[i] != values[i + (ElementCount / 2)]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512>() / sizeof(Byte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Byte[] values = new Byte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetByte(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + Byte result = value.ToScalar(); + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Byte[] values = new Byte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetByte(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.ToScalar)) + .MakeGenericMethod(typeof(Byte)) + .Invoke(null, new object[] { value }); + + ValidateResult((Byte)(result), values); + } + + private void ValidateResult(Byte result, Byte[] values, [CallerMemberName] string method = "") + { + if (result != values[0]) + { + TestLibrary.TestFramework.LogInformation($"Vector512.ToScalar(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" values: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Double.cs new file mode 100644 index 00000000000000..2e3bdedbc5d337 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Double.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void ToScalarDouble() + { + var test = new VectorToScalar__ToScalarDouble(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorToScalar__ToScalarDouble + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Double[] values = new Double[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetDouble(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + Double result = value.ToScalar(); + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Double[] values = new Double[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetDouble(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.ToScalar)) + .MakeGenericMethod(typeof(Double)) + .Invoke(null, new object[] { value }); + + ValidateResult((Double)(result), values); + } + + private void ValidateResult(Double result, Double[] values, [CallerMemberName] string method = "") + { + if (result != values[0]) + { + TestLibrary.TestFramework.LogInformation($"Vector512.ToScalar(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" values: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int16.cs new file mode 100644 index 00000000000000..735a35fcf2ce6f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int16.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void ToScalarInt16() + { + var test = new VectorToScalar__ToScalarInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorToScalar__ToScalarInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int16[] values = new Int16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt16(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + Int16 result = value.ToScalar(); + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Int16[] values = new Int16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt16(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.ToScalar)) + .MakeGenericMethod(typeof(Int16)) + .Invoke(null, new object[] { value }); + + ValidateResult((Int16)(result), values); + } + + private void ValidateResult(Int16 result, Int16[] values, [CallerMemberName] string method = "") + { + if (result != values[0]) + { + TestLibrary.TestFramework.LogInformation($"Vector512.ToScalar(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" values: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int32.cs new file mode 100644 index 00000000000000..4eefa445478ec0 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int32.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void ToScalarInt32() + { + var test = new VectorToScalar__ToScalarInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorToScalar__ToScalarInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int32[] values = new Int32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt32(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + Int32 result = value.ToScalar(); + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Int32[] values = new Int32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt32(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.ToScalar)) + .MakeGenericMethod(typeof(Int32)) + .Invoke(null, new object[] { value }); + + ValidateResult((Int32)(result), values); + } + + private void ValidateResult(Int32 result, Int32[] values, [CallerMemberName] string method = "") + { + if (result != values[0]) + { + TestLibrary.TestFramework.LogInformation($"Vector512.ToScalar(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" values: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int64.cs new file mode 100644 index 00000000000000..08466f04ad4532 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int64.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void ToScalarInt64() + { + var test = new VectorToScalar__ToScalarInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorToScalar__ToScalarInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Int64[] values = new Int64[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt64(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + Int64 result = value.ToScalar(); + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Int64[] values = new Int64[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetInt64(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.ToScalar)) + .MakeGenericMethod(typeof(Int64)) + .Invoke(null, new object[] { value }); + + ValidateResult((Int64)(result), values); + } + + private void ValidateResult(Int64 result, Int64[] values, [CallerMemberName] string method = "") + { + if (result != values[0]) + { + TestLibrary.TestFramework.LogInformation($"Vector512.ToScalar(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" values: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.SByte.cs new file mode 100644 index 00000000000000..3ab158d08ce95d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.SByte.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void ToScalarSByte() + { + var test = new VectorToScalar__ToScalarSByte(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorToScalar__ToScalarSByte + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + SByte[] values = new SByte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetSByte(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + SByte result = value.ToScalar(); + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + SByte[] values = new SByte[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetSByte(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.ToScalar)) + .MakeGenericMethod(typeof(SByte)) + .Invoke(null, new object[] { value }); + + ValidateResult((SByte)(result), values); + } + + private void ValidateResult(SByte result, SByte[] values, [CallerMemberName] string method = "") + { + if (result != values[0]) + { + TestLibrary.TestFramework.LogInformation($"Vector512.ToScalar(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" values: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Single.cs new file mode 100644 index 00000000000000..195b33885ca9c1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Single.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void ToScalarSingle() + { + var test = new VectorToScalar__ToScalarSingle(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorToScalar__ToScalarSingle + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Single[] values = new Single[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetSingle(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + Single result = value.ToScalar(); + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + Single[] values = new Single[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetSingle(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.ToScalar)) + .MakeGenericMethod(typeof(Single)) + .Invoke(null, new object[] { value }); + + ValidateResult((Single)(result), values); + } + + private void ValidateResult(Single result, Single[] values, [CallerMemberName] string method = "") + { + if (result != values[0]) + { + TestLibrary.TestFramework.LogInformation($"Vector512.ToScalar(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" values: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt16.cs new file mode 100644 index 00000000000000..8130b2031376f3 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt16.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void ToScalarUInt16() + { + var test = new VectorToScalar__ToScalarUInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorToScalar__ToScalarUInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt16[] values = new UInt16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt16(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + UInt16 result = value.ToScalar(); + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + UInt16[] values = new UInt16[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt16(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.ToScalar)) + .MakeGenericMethod(typeof(UInt16)) + .Invoke(null, new object[] { value }); + + ValidateResult((UInt16)(result), values); + } + + private void ValidateResult(UInt16 result, UInt16[] values, [CallerMemberName] string method = "") + { + if (result != values[0]) + { + TestLibrary.TestFramework.LogInformation($"Vector512.ToScalar(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" values: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt32.cs new file mode 100644 index 00000000000000..4d2b10d4dad57b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt32.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void ToScalarUInt32() + { + var test = new VectorToScalar__ToScalarUInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorToScalar__ToScalarUInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt32[] values = new UInt32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt32(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + UInt32 result = value.ToScalar(); + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + UInt32[] values = new UInt32[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt32(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.ToScalar)) + .MakeGenericMethod(typeof(UInt32)) + .Invoke(null, new object[] { value }); + + ValidateResult((UInt32)(result), values); + } + + private void ValidateResult(UInt32 result, UInt32[] values, [CallerMemberName] string method = "") + { + if (result != values[0]) + { + TestLibrary.TestFramework.LogInformation($"Vector512.ToScalar(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" values: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt64.cs new file mode 100644 index 00000000000000..d218bcae49acbd --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt64.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void ToScalarUInt64() + { + var test = new VectorToScalar__ToScalarUInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorToScalar__ToScalarUInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + UInt64[] values = new UInt64[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt64(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + UInt64 result = value.ToScalar(); + ValidateResult(result, values); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + UInt64[] values = new UInt64[ElementCount]; + + for (int i = 0; i < ElementCount; i++) + { + values[i] = TestLibrary.Generator.GetUInt64(); + } + + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + + object result = typeof(Vector512) + .GetMethod(nameof(Vector512.ToScalar)) + .MakeGenericMethod(typeof(UInt64)) + .Invoke(null, new object[] { value }); + + ValidateResult((UInt64)(result), values); + } + + private void ValidateResult(UInt64 result, UInt64[] values, [CallerMemberName] string method = "") + { + if (result != values[0]) + { + TestLibrary.TestFramework.LogInformation($"Vector512.ToScalar(): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" values: ({string.Join(", ", values)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Byte.cs new file mode 100644 index 00000000000000..06406e7f1ecc82 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Byte.cs @@ -0,0 +1,51 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public unsafe static void ToStringByte() + { + int size = Unsafe.SizeOf>() / sizeof(Byte); + Byte[] values = new Byte[size]; + + for (int i = 0; i < size; i++) + { + values[i] = TestLibrary.Generator.GetByte(); + } + + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + string actual = vector.ToString(); + + string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; + + bool succeeded = string.Equals(expected, actual, StringComparison.Ordinal); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512ByteToString: Vector512.ToString() returned an unexpected result."); + TestLibrary.TestFramework.LogInformation($"Expected: {expected}"); + TestLibrary.TestFramework.LogInformation($"Actual: {actual}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Double.cs new file mode 100644 index 00000000000000..e8d080eaaed3af --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Double.cs @@ -0,0 +1,51 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public unsafe static void ToStringDouble() + { + int size = Unsafe.SizeOf>() / sizeof(Double); + Double[] values = new Double[size]; + + for (int i = 0; i < size; i++) + { + values[i] = TestLibrary.Generator.GetDouble(); + } + + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3]); + string actual = vector.ToString(); + + string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; + + bool succeeded = string.Equals(expected, actual, StringComparison.Ordinal); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512DoubleToString: Vector512.ToString() returned an unexpected result."); + TestLibrary.TestFramework.LogInformation($"Expected: {expected}"); + TestLibrary.TestFramework.LogInformation($"Actual: {actual}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int16.cs new file mode 100644 index 00000000000000..5adb5c70093f44 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int16.cs @@ -0,0 +1,51 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public unsafe static void ToStringInt16() + { + int size = Unsafe.SizeOf>() / sizeof(Int16); + Int16[] values = new Int16[size]; + + for (int i = 0; i < size; i++) + { + values[i] = TestLibrary.Generator.GetInt16(); + } + + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + string actual = vector.ToString(); + + string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; + + bool succeeded = string.Equals(expected, actual, StringComparison.Ordinal); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512Int16ToString: Vector512.ToString() returned an unexpected result."); + TestLibrary.TestFramework.LogInformation($"Expected: {expected}"); + TestLibrary.TestFramework.LogInformation($"Actual: {actual}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int32.cs new file mode 100644 index 00000000000000..248ab1b704dd43 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int32.cs @@ -0,0 +1,51 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public unsafe static void ToStringInt32() + { + int size = Unsafe.SizeOf>() / sizeof(Int32); + Int32[] values = new Int32[size]; + + for (int i = 0; i < size; i++) + { + values[i] = TestLibrary.Generator.GetInt32(); + } + + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + string actual = vector.ToString(); + + string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; + + bool succeeded = string.Equals(expected, actual, StringComparison.Ordinal); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512Int32ToString: Vector512.ToString() returned an unexpected result."); + TestLibrary.TestFramework.LogInformation($"Expected: {expected}"); + TestLibrary.TestFramework.LogInformation($"Actual: {actual}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int64.cs new file mode 100644 index 00000000000000..72628f1971d081 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int64.cs @@ -0,0 +1,51 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public unsafe static void ToStringInt64() + { + int size = Unsafe.SizeOf>() / sizeof(Int64); + Int64[] values = new Int64[size]; + + for (int i = 0; i < size; i++) + { + values[i] = TestLibrary.Generator.GetInt64(); + } + + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3]); + string actual = vector.ToString(); + + string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; + + bool succeeded = string.Equals(expected, actual, StringComparison.Ordinal); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512Int64ToString: Vector512.ToString() returned an unexpected result."); + TestLibrary.TestFramework.LogInformation($"Expected: {expected}"); + TestLibrary.TestFramework.LogInformation($"Actual: {actual}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.SByte.cs new file mode 100644 index 00000000000000..e439bc6cd0cd9f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.SByte.cs @@ -0,0 +1,51 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public unsafe static void ToStringSByte() + { + int size = Unsafe.SizeOf>() / sizeof(SByte); + SByte[] values = new SByte[size]; + + for (int i = 0; i < size; i++) + { + values[i] = TestLibrary.Generator.GetSByte(); + } + + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + string actual = vector.ToString(); + + string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; + + bool succeeded = string.Equals(expected, actual, StringComparison.Ordinal); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512SByteToString: Vector512.ToString() returned an unexpected result."); + TestLibrary.TestFramework.LogInformation($"Expected: {expected}"); + TestLibrary.TestFramework.LogInformation($"Actual: {actual}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Single.cs new file mode 100644 index 00000000000000..3ed44005ce289f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Single.cs @@ -0,0 +1,51 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public unsafe static void ToStringSingle() + { + int size = Unsafe.SizeOf>() / sizeof(Single); + Single[] values = new Single[size]; + + for (int i = 0; i < size; i++) + { + values[i] = TestLibrary.Generator.GetSingle(); + } + + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + string actual = vector.ToString(); + + string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; + + bool succeeded = string.Equals(expected, actual, StringComparison.Ordinal); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512SingleToString: Vector512.ToString() returned an unexpected result."); + TestLibrary.TestFramework.LogInformation($"Expected: {expected}"); + TestLibrary.TestFramework.LogInformation($"Actual: {actual}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt16.cs new file mode 100644 index 00000000000000..ab54dc24e590aa --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt16.cs @@ -0,0 +1,51 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public unsafe static void ToStringUInt16() + { + int size = Unsafe.SizeOf>() / sizeof(UInt16); + UInt16[] values = new UInt16[size]; + + for (int i = 0; i < size; i++) + { + values[i] = TestLibrary.Generator.GetUInt16(); + } + + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + string actual = vector.ToString(); + + string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; + + bool succeeded = string.Equals(expected, actual, StringComparison.Ordinal); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512UInt16ToString: Vector512.ToString() returned an unexpected result."); + TestLibrary.TestFramework.LogInformation($"Expected: {expected}"); + TestLibrary.TestFramework.LogInformation($"Actual: {actual}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt32.cs new file mode 100644 index 00000000000000..84a60f149c983f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt32.cs @@ -0,0 +1,51 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public unsafe static void ToStringUInt32() + { + int size = Unsafe.SizeOf>() / sizeof(UInt32); + UInt32[] values = new UInt32[size]; + + for (int i = 0; i < size; i++) + { + values[i] = TestLibrary.Generator.GetUInt32(); + } + + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + string actual = vector.ToString(); + + string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; + + bool succeeded = string.Equals(expected, actual, StringComparison.Ordinal); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512UInt32ToString: Vector512.ToString() returned an unexpected result."); + TestLibrary.TestFramework.LogInformation($"Expected: {expected}"); + TestLibrary.TestFramework.LogInformation($"Actual: {actual}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt64.cs new file mode 100644 index 00000000000000..bd1e6c8250101f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt64.cs @@ -0,0 +1,51 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public unsafe static void ToStringUInt64() + { + int size = Unsafe.SizeOf>() / sizeof(UInt64); + UInt64[] values = new UInt64[size]; + + for (int i = 0; i < size; i++) + { + values[i] = TestLibrary.Generator.GetUInt64(); + } + + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3]); + string actual = vector.ToString(); + + string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; + + bool succeeded = string.Equals(expected, actual, StringComparison.Ordinal); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512UInt64ToString: Vector512.ToString() returned an unexpected result."); + TestLibrary.TestFramework.LogInformation($"Expected: {expected}"); + TestLibrary.TestFramework.LogInformation($"Actual: {actual}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Vector512_1_r.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Vector512_1_r.csproj new file mode 100644 index 00000000000000..3c66fb4d66efbb --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Vector512_1_r.csproj @@ -0,0 +1,241 @@ + + + false + true + + + Embedded + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Vector512_1_ro.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Vector512_1_ro.csproj new file mode 100644 index 00000000000000..d2a8b545bb327c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Vector512_1_ro.csproj @@ -0,0 +1,241 @@ + + + false + true + + + Embedded + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Byte.cs new file mode 100644 index 00000000000000..b86ad2e766cac8 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Byte.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void ZeroByte() + { + var test = new VectorZero__ZeroByte(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorZero__ZeroByte + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.Zero; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.Zero), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + Byte[] resultElements = new Byte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private void ValidateResult(Byte[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Zero(Byte): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Double.cs new file mode 100644 index 00000000000000..5d898d07b2186c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Double.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void ZeroDouble() + { + var test = new VectorZero__ZeroDouble(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorZero__ZeroDouble + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.Zero; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.Zero), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + Double[] resultElements = new Double[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private void ValidateResult(Double[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Zero(Double): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Int16.cs new file mode 100644 index 00000000000000..730185cb7fb769 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Int16.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void ZeroInt16() + { + var test = new VectorZero__ZeroInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorZero__ZeroInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.Zero; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.Zero), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + Int16[] resultElements = new Int16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private void ValidateResult(Int16[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Zero(Int16): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Int32.cs new file mode 100644 index 00000000000000..5453e8422735bd --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Int32.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void ZeroInt32() + { + var test = new VectorZero__ZeroInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorZero__ZeroInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.Zero; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.Zero), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + Int32[] resultElements = new Int32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private void ValidateResult(Int32[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Zero(Int32): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Int64.cs new file mode 100644 index 00000000000000..9f806ad03aa772 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Int64.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void ZeroInt64() + { + var test = new VectorZero__ZeroInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorZero__ZeroInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.Zero; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.Zero), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + Int64[] resultElements = new Int64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private void ValidateResult(Int64[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Zero(Int64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.SByte.cs new file mode 100644 index 00000000000000..277c9e3e67f0b7 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.SByte.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void ZeroSByte() + { + var test = new VectorZero__ZeroSByte(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorZero__ZeroSByte + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.Zero; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.Zero), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + SByte[] resultElements = new SByte[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private void ValidateResult(SByte[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Zero(SByte): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Single.cs new file mode 100644 index 00000000000000..aa9f1166f5756b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.Single.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void ZeroSingle() + { + var test = new VectorZero__ZeroSingle(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorZero__ZeroSingle + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.Zero; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.Zero), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + Single[] resultElements = new Single[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private void ValidateResult(Single[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Zero(Single): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.UInt16.cs new file mode 100644 index 00000000000000..6ccc3c7c7beb98 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.UInt16.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void ZeroUInt16() + { + var test = new VectorZero__ZeroUInt16(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorZero__ZeroUInt16 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.Zero; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.Zero), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + UInt16[] resultElements = new UInt16[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private void ValidateResult(UInt16[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Zero(UInt16): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.UInt32.cs new file mode 100644 index 00000000000000..273f5b0c3ddb3a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.UInt32.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void ZeroUInt32() + { + var test = new VectorZero__ZeroUInt32(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorZero__ZeroUInt32 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.Zero; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.Zero), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + UInt32[] resultElements = new UInt32[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private void ValidateResult(UInt32[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Zero(UInt32): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.UInt64.cs new file mode 100644 index 00000000000000..35737f67407d58 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Zero.UInt64.cs @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\General\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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void ZeroUInt64() + { + var test = new VectorZero__ZeroUInt64(); + + // Validates basic functionality works + test.RunBasicScenario(); + + // Validates calling via reflection works + test.RunReflectionScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorZero__ZeroUInt64 + { + private static readonly int LargestVectorSize = 64; + + private static readonly int ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + public bool Succeeded { get; set; } = true; + + public void RunBasicScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); + + Vector512 result = Vector512.Zero; + + ValidateResult(result); + } + + public void RunReflectionScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); + + object result = typeof(Vector512) + .GetProperty(nameof(Vector512.Zero), new Type[] { }) + .GetGetMethod() + .Invoke(null, new object[] { }); + + ValidateResult((Vector512)(result)); + } + + private void ValidateResult(Vector512 result, [CallerMemberName] string method = "") + { + UInt64[] resultElements = new UInt64[ElementCount]; + Unsafe.WriteUnaligned(ref Unsafe.As(ref resultElements[0]), result); + ValidateResult(resultElements, method); + } + + private void ValidateResult(UInt64[] resultElements, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < ElementCount; i++) + { + if (resultElements[i] != 0) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"Vector512.Zero(UInt64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Byte.cs new file mode 100644 index 00000000000000..b76d8aff225d55 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Byte.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_AdditionByte() + { + var test = new VectorBinaryOpTest__op_AdditionByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_AdditionByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_AdditionByte testClass) + { + var result = _fld1 + _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_AdditionByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_AdditionByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) + Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Addition", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 + _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 + op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_AdditionByte(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 + _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Addition(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Double.cs new file mode 100644 index 00000000000000..dfab4fb1a989ff --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Double.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_AdditionDouble() + { + var test = new VectorBinaryOpTest__op_AdditionDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_AdditionDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_AdditionDouble testClass) + { + var result = _fld1 + _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_AdditionDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_AdditionDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) + Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Addition", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 + _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 + op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_AdditionDouble(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 + _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (double)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (double)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Addition(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int16.cs new file mode 100644 index 00000000000000..c87de044e8f59d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int16.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_AdditionInt16() + { + var test = new VectorBinaryOpTest__op_AdditionInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_AdditionInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_AdditionInt16 testClass) + { + var result = _fld1 + _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_AdditionInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_AdditionInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) + Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Addition", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 + _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 + op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_AdditionInt16(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 + _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Addition(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int32.cs new file mode 100644 index 00000000000000..066fb9a009a043 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int32.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_AdditionInt32() + { + var test = new VectorBinaryOpTest__op_AdditionInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_AdditionInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_AdditionInt32 testClass) + { + var result = _fld1 + _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_AdditionInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_AdditionInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) + Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Addition", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 + _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 + op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_AdditionInt32(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 + _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Addition(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int64.cs new file mode 100644 index 00000000000000..be56410a6d79d6 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int64.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_AdditionInt64() + { + var test = new VectorBinaryOpTest__op_AdditionInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_AdditionInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_AdditionInt64 testClass) + { + var result = _fld1 + _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_AdditionInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_AdditionInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) + Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Addition", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 + _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 + op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_AdditionInt64(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 + _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Addition(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.SByte.cs new file mode 100644 index 00000000000000..59d2e4a2f11f9b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.SByte.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_AdditionSByte() + { + var test = new VectorBinaryOpTest__op_AdditionSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_AdditionSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_AdditionSByte testClass) + { + var result = _fld1 + _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_AdditionSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_AdditionSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) + Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Addition", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 + _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 + op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_AdditionSByte(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 + _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Addition(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Single.cs new file mode 100644 index 00000000000000..fd7ba0a2870a21 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Single.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_AdditionSingle() + { + var test = new VectorBinaryOpTest__op_AdditionSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_AdditionSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_AdditionSingle testClass) + { + var result = _fld1 + _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_AdditionSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_AdditionSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) + Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Addition", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 + _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 + op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_AdditionSingle(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 + _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (float)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (float)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Addition(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt16.cs new file mode 100644 index 00000000000000..82079982ab8545 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt16.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_AdditionUInt16() + { + var test = new VectorBinaryOpTest__op_AdditionUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_AdditionUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_AdditionUInt16 testClass) + { + var result = _fld1 + _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_AdditionUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_AdditionUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) + Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Addition", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 + _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 + op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_AdditionUInt16(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 + _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Addition(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt32.cs new file mode 100644 index 00000000000000..dcd7c502c0e6ca --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt32.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_AdditionUInt32() + { + var test = new VectorBinaryOpTest__op_AdditionUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_AdditionUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_AdditionUInt32 testClass) + { + var result = _fld1 + _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_AdditionUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_AdditionUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) + Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Addition", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 + _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 + op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_AdditionUInt32(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 + _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Addition(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt64.cs new file mode 100644 index 00000000000000..967afdc2562b15 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt64.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_AdditionUInt64() + { + var test = new VectorBinaryOpTest__op_AdditionUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_AdditionUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_AdditionUInt64 testClass) + { + var result = _fld1 + _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_AdditionUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_AdditionUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) + Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Addition", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 + _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 + op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_AdditionUInt64(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 + _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 + test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(left[0] + right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(left[i] + right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Addition(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Byte.cs new file mode 100644 index 00000000000000..9f9d2df42d524b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Byte.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseAndByte() + { + var test = new VectorBinaryOpTest__op_BitwiseAndByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseAndByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseAndByte testClass) + { + var result = _fld1 & _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseAndByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseAndByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) & Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseAnd", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 & _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 & op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseAndByte(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 & _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(left[0] & right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(left[i] & right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseAnd(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Double.cs new file mode 100644 index 00000000000000..e7eb3282689d4f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Double.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseAndDouble() + { + var test = new VectorBinaryOpTest__op_BitwiseAndDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseAndDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseAndDouble testClass) + { + var result = _fld1 & _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseAndDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseAndDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) & Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseAnd", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 & _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 & op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseAndDouble(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 & _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.DoubleToInt64Bits(result[0]) != (BitConverter.DoubleToInt64Bits(left[0]) & BitConverter.DoubleToInt64Bits(right[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(result[i]) != (BitConverter.DoubleToInt64Bits(left[i]) & BitConverter.DoubleToInt64Bits(right[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseAnd(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int16.cs new file mode 100644 index 00000000000000..3e42999b4a5811 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int16.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseAndInt16() + { + var test = new VectorBinaryOpTest__op_BitwiseAndInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseAndInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseAndInt16 testClass) + { + var result = _fld1 & _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseAndInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseAndInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) & Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseAnd", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 & _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 & op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseAndInt16(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 & _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(left[0] & right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(left[i] & right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseAnd(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int32.cs new file mode 100644 index 00000000000000..946ac2687b3264 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int32.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseAndInt32() + { + var test = new VectorBinaryOpTest__op_BitwiseAndInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseAndInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseAndInt32 testClass) + { + var result = _fld1 & _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseAndInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseAndInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) & Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseAnd", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 & _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 & op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseAndInt32(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 & _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(left[0] & right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(left[i] & right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseAnd(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int64.cs new file mode 100644 index 00000000000000..02d8fdc8493609 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int64.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseAndInt64() + { + var test = new VectorBinaryOpTest__op_BitwiseAndInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseAndInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseAndInt64 testClass) + { + var result = _fld1 & _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseAndInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseAndInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) & Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseAnd", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 & _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 & op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseAndInt64(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 & _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(left[0] & right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(left[i] & right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseAnd(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.SByte.cs new file mode 100644 index 00000000000000..585842062c6d47 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.SByte.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseAndSByte() + { + var test = new VectorBinaryOpTest__op_BitwiseAndSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseAndSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseAndSByte testClass) + { + var result = _fld1 & _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseAndSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseAndSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) & Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseAnd", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 & _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 & op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseAndSByte(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 & _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(left[0] & right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(left[i] & right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseAnd(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Single.cs new file mode 100644 index 00000000000000..b80d6b05889bdc --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Single.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseAndSingle() + { + var test = new VectorBinaryOpTest__op_BitwiseAndSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseAndSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseAndSingle testClass) + { + var result = _fld1 & _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseAndSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseAndSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) & Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseAnd", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 & _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 & op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseAndSingle(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 & _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.SingleToInt32Bits(result[0]) != (BitConverter.SingleToInt32Bits(left[0]) & BitConverter.SingleToInt32Bits(right[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(result[i]) != (BitConverter.SingleToInt32Bits(left[i]) & BitConverter.SingleToInt32Bits(right[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseAnd(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt16.cs new file mode 100644 index 00000000000000..db9c0896fa61f0 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt16.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseAndUInt16() + { + var test = new VectorBinaryOpTest__op_BitwiseAndUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseAndUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseAndUInt16 testClass) + { + var result = _fld1 & _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseAndUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseAndUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) & Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseAnd", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 & _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 & op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseAndUInt16(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 & _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(left[0] & right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(left[i] & right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseAnd(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt32.cs new file mode 100644 index 00000000000000..0de90af0052772 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt32.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseAndUInt32() + { + var test = new VectorBinaryOpTest__op_BitwiseAndUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseAndUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseAndUInt32 testClass) + { + var result = _fld1 & _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseAndUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseAndUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) & Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseAnd", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 & _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 & op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseAndUInt32(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 & _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(left[0] & right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(left[i] & right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseAnd(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt64.cs new file mode 100644 index 00000000000000..d08ff67f6001c1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt64.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseAndUInt64() + { + var test = new VectorBinaryOpTest__op_BitwiseAndUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseAndUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseAndUInt64 testClass) + { + var result = _fld1 & _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseAndUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseAndUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) & Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseAnd", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 & _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 & op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseAndUInt64(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 & _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 & test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(left[0] & right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(left[i] & right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseAnd(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Byte.cs new file mode 100644 index 00000000000000..9b0dc1a6306352 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Byte.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseOrByte() + { + var test = new VectorBinaryOpTest__op_BitwiseOrByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseOrByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseOrByte testClass) + { + var result = _fld1 | _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseOrByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseOrByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) | Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 | _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 | op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseOrByte(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 | _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(left[0] | right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(left[i] | right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Double.cs new file mode 100644 index 00000000000000..ada7855d0cbe80 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Double.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseOrDouble() + { + var test = new VectorBinaryOpTest__op_BitwiseOrDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseOrDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseOrDouble testClass) + { + var result = _fld1 | _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseOrDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseOrDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) | Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 | _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 | op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseOrDouble(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 | _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.DoubleToInt64Bits(result[0]) != (BitConverter.DoubleToInt64Bits(left[0]) | BitConverter.DoubleToInt64Bits(right[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(result[i]) != (BitConverter.DoubleToInt64Bits(left[i]) | BitConverter.DoubleToInt64Bits(right[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int16.cs new file mode 100644 index 00000000000000..69f432e8c74346 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int16.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseOrInt16() + { + var test = new VectorBinaryOpTest__op_BitwiseOrInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseOrInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseOrInt16 testClass) + { + var result = _fld1 | _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseOrInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseOrInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) | Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 | _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 | op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseOrInt16(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 | _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(left[0] | right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(left[i] | right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int32.cs new file mode 100644 index 00000000000000..0eb11521fabcb1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int32.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseOrInt32() + { + var test = new VectorBinaryOpTest__op_BitwiseOrInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseOrInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseOrInt32 testClass) + { + var result = _fld1 | _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseOrInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseOrInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) | Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 | _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 | op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseOrInt32(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 | _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(left[0] | right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(left[i] | right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int64.cs new file mode 100644 index 00000000000000..41c6d817e56ebe --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int64.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseOrInt64() + { + var test = new VectorBinaryOpTest__op_BitwiseOrInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseOrInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseOrInt64 testClass) + { + var result = _fld1 | _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseOrInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseOrInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) | Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 | _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 | op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseOrInt64(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 | _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(left[0] | right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(left[i] | right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.SByte.cs new file mode 100644 index 00000000000000..8ed05ca0f57a48 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.SByte.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseOrSByte() + { + var test = new VectorBinaryOpTest__op_BitwiseOrSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseOrSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseOrSByte testClass) + { + var result = _fld1 | _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseOrSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseOrSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) | Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 | _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 | op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseOrSByte(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 | _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(left[0] | right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(left[i] | right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Single.cs new file mode 100644 index 00000000000000..06b5fd2c0fa630 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Single.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseOrSingle() + { + var test = new VectorBinaryOpTest__op_BitwiseOrSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseOrSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseOrSingle testClass) + { + var result = _fld1 | _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseOrSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseOrSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) | Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 | _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 | op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseOrSingle(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 | _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.SingleToInt32Bits(result[0]) != (BitConverter.SingleToInt32Bits(left[0]) | BitConverter.SingleToInt32Bits(right[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(result[i]) != (BitConverter.SingleToInt32Bits(left[i]) | BitConverter.SingleToInt32Bits(right[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt16.cs new file mode 100644 index 00000000000000..1b05eaa4f4da86 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt16.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseOrUInt16() + { + var test = new VectorBinaryOpTest__op_BitwiseOrUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseOrUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseOrUInt16 testClass) + { + var result = _fld1 | _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseOrUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseOrUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) | Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 | _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 | op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseOrUInt16(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 | _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(left[0] | right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(left[i] | right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt32.cs new file mode 100644 index 00000000000000..d2f2d0f05e2342 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt32.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseOrUInt32() + { + var test = new VectorBinaryOpTest__op_BitwiseOrUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseOrUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseOrUInt32 testClass) + { + var result = _fld1 | _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseOrUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseOrUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) | Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 | _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 | op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseOrUInt32(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 | _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(left[0] | right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(left[i] | right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt64.cs new file mode 100644 index 00000000000000..875ac2ed82b74f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt64.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_BitwiseOrUInt64() + { + var test = new VectorBinaryOpTest__op_BitwiseOrUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_BitwiseOrUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_BitwiseOrUInt64 testClass) + { + var result = _fld1 | _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_BitwiseOrUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_BitwiseOrUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) | Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_BitwiseOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 | _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 | op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_BitwiseOrUInt64(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 | _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 | test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(left[0] | right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(left[i] | right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_BitwiseOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Byte.cs new file mode 100644 index 00000000000000..1175d683ec5978 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Byte.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_DivisionByte() + { + var test = new VectorBinaryOpTest__op_DivisionByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_DivisionByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((byte)(1), TestLibrary.Generator.GetByte()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_DivisionByte testClass) + { + var result = _fld1 / _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_DivisionByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((byte)(1), TestLibrary.Generator.GetByte()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_DivisionByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((byte)(1), TestLibrary.Generator.GetByte()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((byte)(1), TestLibrary.Generator.GetByte()); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) / Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Division", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 / _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 / op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_DivisionByte(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 / _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Division(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Double.cs new file mode 100644 index 00000000000000..c30ce5d2a3b131 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Double.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_DivisionDouble() + { + var test = new VectorBinaryOpTest__op_DivisionDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_DivisionDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((double)(1), TestLibrary.Generator.GetDouble()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_DivisionDouble testClass) + { + var result = _fld1 / _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_DivisionDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((double)(1), TestLibrary.Generator.GetDouble()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_DivisionDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((double)(1), TestLibrary.Generator.GetDouble()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((double)(1), TestLibrary.Generator.GetDouble()); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) / Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Division", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 / _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 / op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_DivisionDouble(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 / _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (double)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (double)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Division(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int16.cs new file mode 100644 index 00000000000000..3cc7d488bd6bc2 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int16.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_DivisionInt16() + { + var test = new VectorBinaryOpTest__op_DivisionInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_DivisionInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((short)(1), TestLibrary.Generator.GetInt16()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_DivisionInt16 testClass) + { + var result = _fld1 / _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_DivisionInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((short)(1), TestLibrary.Generator.GetInt16()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_DivisionInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((short)(1), TestLibrary.Generator.GetInt16()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((short)(1), TestLibrary.Generator.GetInt16()); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) / Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Division", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 / _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 / op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_DivisionInt16(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 / _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Division(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int32.cs new file mode 100644 index 00000000000000..e82b71e1b368bf --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int32.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_DivisionInt32() + { + var test = new VectorBinaryOpTest__op_DivisionInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_DivisionInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((int)(1), TestLibrary.Generator.GetInt32()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_DivisionInt32 testClass) + { + var result = _fld1 / _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_DivisionInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((int)(1), TestLibrary.Generator.GetInt32()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_DivisionInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((int)(1), TestLibrary.Generator.GetInt32()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((int)(1), TestLibrary.Generator.GetInt32()); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) / Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Division", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 / _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 / op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_DivisionInt32(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 / _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Division(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int64.cs new file mode 100644 index 00000000000000..9ba75ca2415efc --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int64.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_DivisionInt64() + { + var test = new VectorBinaryOpTest__op_DivisionInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_DivisionInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((long)(1), TestLibrary.Generator.GetInt64()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_DivisionInt64 testClass) + { + var result = _fld1 / _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_DivisionInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((long)(1), TestLibrary.Generator.GetInt64()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_DivisionInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((long)(1), TestLibrary.Generator.GetInt64()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((long)(1), TestLibrary.Generator.GetInt64()); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) / Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Division", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 / _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 / op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_DivisionInt64(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 / _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Division(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.SByte.cs new file mode 100644 index 00000000000000..445acfd8934311 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.SByte.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_DivisionSByte() + { + var test = new VectorBinaryOpTest__op_DivisionSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_DivisionSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((sbyte)(1), TestLibrary.Generator.GetSByte()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_DivisionSByte testClass) + { + var result = _fld1 / _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_DivisionSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((sbyte)(1), TestLibrary.Generator.GetSByte()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_DivisionSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((sbyte)(1), TestLibrary.Generator.GetSByte()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((sbyte)(1), TestLibrary.Generator.GetSByte()); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) / Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Division", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 / _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 / op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_DivisionSByte(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 / _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Division(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Single.cs new file mode 100644 index 00000000000000..6a74f4863e9e8c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Single.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_DivisionSingle() + { + var test = new VectorBinaryOpTest__op_DivisionSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_DivisionSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((float)(1), TestLibrary.Generator.GetSingle()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_DivisionSingle testClass) + { + var result = _fld1 / _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_DivisionSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((float)(1), TestLibrary.Generator.GetSingle()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_DivisionSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((float)(1), TestLibrary.Generator.GetSingle()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((float)(1), TestLibrary.Generator.GetSingle()); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) / Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Division", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 / _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 / op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_DivisionSingle(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 / _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (float)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (float)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Division(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt16.cs new file mode 100644 index 00000000000000..c4e6eb25d99e88 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt16.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_DivisionUInt16() + { + var test = new VectorBinaryOpTest__op_DivisionUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_DivisionUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((ushort)(1), TestLibrary.Generator.GetUInt16()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_DivisionUInt16 testClass) + { + var result = _fld1 / _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_DivisionUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((ushort)(1), TestLibrary.Generator.GetUInt16()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_DivisionUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((ushort)(1), TestLibrary.Generator.GetUInt16()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((ushort)(1), TestLibrary.Generator.GetUInt16()); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) / Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Division", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 / _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 / op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_DivisionUInt16(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 / _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Division(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt32.cs new file mode 100644 index 00000000000000..807a4749fc5298 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt32.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_DivisionUInt32() + { + var test = new VectorBinaryOpTest__op_DivisionUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_DivisionUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((uint)(1), TestLibrary.Generator.GetUInt32()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_DivisionUInt32 testClass) + { + var result = _fld1 / _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_DivisionUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((uint)(1), TestLibrary.Generator.GetUInt32()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_DivisionUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((uint)(1), TestLibrary.Generator.GetUInt32()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((uint)(1), TestLibrary.Generator.GetUInt32()); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) / Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Division", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 / _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 / op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_DivisionUInt32(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 / _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Division(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt64.cs new file mode 100644 index 00000000000000..1092d209bfcffb --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt64.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_DivisionUInt64() + { + var test = new VectorBinaryOpTest__op_DivisionUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_DivisionUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((ulong)(1), TestLibrary.Generator.GetUInt64()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_DivisionUInt64 testClass) + { + var result = _fld1 / _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_DivisionUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((ulong)(1), TestLibrary.Generator.GetUInt64()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_DivisionUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((ulong)(1), TestLibrary.Generator.GetUInt64()); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = Math.Max((ulong)(1), TestLibrary.Generator.GetUInt64()); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) / Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Division", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 / _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 / op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_DivisionUInt64(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 / _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 / test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(left[0] / right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(left[i] / right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Division(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Byte.cs new file mode 100644 index 00000000000000..047c1e7e4e45a7 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Byte.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_EqualityByte() + { + var test = new VectorBooleanBinaryOpTest__op_EqualityByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_EqualityByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_EqualityByte testClass) + { + var result = _fld1 == _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_EqualityByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_EqualityByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) == Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Equality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 == _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 == op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_EqualityByte(); + var result = test._fld1 == test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 == _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 == test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Equality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Double.cs new file mode 100644 index 00000000000000..a97324667ab44a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Double.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_EqualityDouble() + { + var test = new VectorBooleanBinaryOpTest__op_EqualityDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_EqualityDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_EqualityDouble testClass) + { + var result = _fld1 == _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_EqualityDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_EqualityDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) == Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Equality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 == _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 == op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_EqualityDouble(); + var result = test._fld1 == test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 == _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 == test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Double[] left, Double[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Equality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int16.cs new file mode 100644 index 00000000000000..5e6949266d83ea --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int16.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_EqualityInt16() + { + var test = new VectorBooleanBinaryOpTest__op_EqualityInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_EqualityInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_EqualityInt16 testClass) + { + var result = _fld1 == _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_EqualityInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_EqualityInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) == Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Equality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 == _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 == op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_EqualityInt16(); + var result = test._fld1 == test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 == _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 == test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Equality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int32.cs new file mode 100644 index 00000000000000..db0e64adc83389 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int32.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_EqualityInt32() + { + var test = new VectorBooleanBinaryOpTest__op_EqualityInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_EqualityInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_EqualityInt32 testClass) + { + var result = _fld1 == _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_EqualityInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_EqualityInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) == Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Equality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 == _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 == op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_EqualityInt32(); + var result = test._fld1 == test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 == _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 == test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Equality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int64.cs new file mode 100644 index 00000000000000..b6b192ee74d8e8 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int64.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_EqualityInt64() + { + var test = new VectorBooleanBinaryOpTest__op_EqualityInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_EqualityInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_EqualityInt64 testClass) + { + var result = _fld1 == _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_EqualityInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_EqualityInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) == Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Equality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 == _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 == op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_EqualityInt64(); + var result = test._fld1 == test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 == _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 == test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Equality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.SByte.cs new file mode 100644 index 00000000000000..a068cb53a062ac --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.SByte.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_EqualitySByte() + { + var test = new VectorBooleanBinaryOpTest__op_EqualitySByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_EqualitySByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_EqualitySByte testClass) + { + var result = _fld1 == _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_EqualitySByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_EqualitySByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) == Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Equality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 == _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 == op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_EqualitySByte(); + var result = test._fld1 == test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 == _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 == test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Equality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Single.cs new file mode 100644 index 00000000000000..d67433bfad5778 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Single.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_EqualitySingle() + { + var test = new VectorBooleanBinaryOpTest__op_EqualitySingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_EqualitySingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_EqualitySingle testClass) + { + var result = _fld1 == _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_EqualitySingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_EqualitySingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) == Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Equality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 == _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 == op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_EqualitySingle(); + var result = test._fld1 == test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 == _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 == test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Single[] left, Single[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Equality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt16.cs new file mode 100644 index 00000000000000..0ad15688b02b1d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt16.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_EqualityUInt16() + { + var test = new VectorBooleanBinaryOpTest__op_EqualityUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_EqualityUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_EqualityUInt16 testClass) + { + var result = _fld1 == _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_EqualityUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_EqualityUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) == Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Equality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 == _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 == op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_EqualityUInt16(); + var result = test._fld1 == test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 == _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 == test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Equality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt32.cs new file mode 100644 index 00000000000000..5723b8578ffabd --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt32.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_EqualityUInt32() + { + var test = new VectorBooleanBinaryOpTest__op_EqualityUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_EqualityUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_EqualityUInt32 testClass) + { + var result = _fld1 == _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_EqualityUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_EqualityUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) == Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Equality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 == _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 == op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_EqualityUInt32(); + var result = test._fld1 == test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 == _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 == test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Equality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt64.cs new file mode 100644 index 00000000000000..b5ca9f30d306d2 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt64.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_EqualityUInt64() + { + var test = new VectorBooleanBinaryOpTest__op_EqualityUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_EqualityUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_EqualityUInt64 testClass) + { + var result = _fld1 == _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_EqualityUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_EqualityUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) == Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Equality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 == _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 == op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_EqualityUInt64(); + var result = test._fld1 == test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 == _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 == test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult &= (left[i] == right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Equality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Byte.cs new file mode 100644 index 00000000000000..3c360f015e19a1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Byte.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_ExclusiveOrByte() + { + var test = new VectorBinaryOpTest__op_ExclusiveOrByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_ExclusiveOrByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_ExclusiveOrByte testClass) + { + var result = _fld1 ^ _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_ExclusiveOrByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_ExclusiveOrByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) ^ Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_ExclusiveOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 ^ _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 ^ op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_ExclusiveOrByte(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 ^ _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(left[0] ^ right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(left[i] ^ right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_ExclusiveOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Double.cs new file mode 100644 index 00000000000000..e41785cc49812d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Double.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_ExclusiveOrDouble() + { + var test = new VectorBinaryOpTest__op_ExclusiveOrDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_ExclusiveOrDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_ExclusiveOrDouble testClass) + { + var result = _fld1 ^ _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_ExclusiveOrDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_ExclusiveOrDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) ^ Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_ExclusiveOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 ^ _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 ^ op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_ExclusiveOrDouble(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 ^ _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.DoubleToInt64Bits(result[0]) != (BitConverter.DoubleToInt64Bits(left[0]) ^ BitConverter.DoubleToInt64Bits(right[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(result[i]) != (BitConverter.DoubleToInt64Bits(left[i]) ^ BitConverter.DoubleToInt64Bits(right[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_ExclusiveOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int16.cs new file mode 100644 index 00000000000000..e50ade29bb2434 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int16.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_ExclusiveOrInt16() + { + var test = new VectorBinaryOpTest__op_ExclusiveOrInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_ExclusiveOrInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_ExclusiveOrInt16 testClass) + { + var result = _fld1 ^ _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_ExclusiveOrInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_ExclusiveOrInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) ^ Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_ExclusiveOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 ^ _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 ^ op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_ExclusiveOrInt16(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 ^ _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(left[0] ^ right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(left[i] ^ right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_ExclusiveOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int32.cs new file mode 100644 index 00000000000000..62ea7456d8e36b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int32.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_ExclusiveOrInt32() + { + var test = new VectorBinaryOpTest__op_ExclusiveOrInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_ExclusiveOrInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_ExclusiveOrInt32 testClass) + { + var result = _fld1 ^ _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_ExclusiveOrInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_ExclusiveOrInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) ^ Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_ExclusiveOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 ^ _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 ^ op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_ExclusiveOrInt32(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 ^ _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(left[0] ^ right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(left[i] ^ right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_ExclusiveOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int64.cs new file mode 100644 index 00000000000000..95a0f94530a031 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int64.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_ExclusiveOrInt64() + { + var test = new VectorBinaryOpTest__op_ExclusiveOrInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_ExclusiveOrInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_ExclusiveOrInt64 testClass) + { + var result = _fld1 ^ _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_ExclusiveOrInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_ExclusiveOrInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) ^ Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_ExclusiveOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 ^ _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 ^ op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_ExclusiveOrInt64(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 ^ _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(left[0] ^ right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(left[i] ^ right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_ExclusiveOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.SByte.cs new file mode 100644 index 00000000000000..ce8d6dcd951359 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.SByte.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_ExclusiveOrSByte() + { + var test = new VectorBinaryOpTest__op_ExclusiveOrSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_ExclusiveOrSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_ExclusiveOrSByte testClass) + { + var result = _fld1 ^ _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_ExclusiveOrSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_ExclusiveOrSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) ^ Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_ExclusiveOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 ^ _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 ^ op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_ExclusiveOrSByte(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 ^ _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(left[0] ^ right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(left[i] ^ right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_ExclusiveOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Single.cs new file mode 100644 index 00000000000000..1b88bdd783d675 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Single.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_ExclusiveOrSingle() + { + var test = new VectorBinaryOpTest__op_ExclusiveOrSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_ExclusiveOrSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_ExclusiveOrSingle testClass) + { + var result = _fld1 ^ _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_ExclusiveOrSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_ExclusiveOrSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) ^ Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_ExclusiveOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 ^ _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 ^ op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_ExclusiveOrSingle(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 ^ _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.SingleToInt32Bits(result[0]) != (BitConverter.SingleToInt32Bits(left[0]) ^ BitConverter.SingleToInt32Bits(right[0]))) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(result[i]) != (BitConverter.SingleToInt32Bits(left[i]) ^ BitConverter.SingleToInt32Bits(right[i]))) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_ExclusiveOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt16.cs new file mode 100644 index 00000000000000..b4459d8f4930e6 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt16.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_ExclusiveOrUInt16() + { + var test = new VectorBinaryOpTest__op_ExclusiveOrUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_ExclusiveOrUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_ExclusiveOrUInt16 testClass) + { + var result = _fld1 ^ _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_ExclusiveOrUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_ExclusiveOrUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) ^ Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_ExclusiveOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 ^ _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 ^ op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_ExclusiveOrUInt16(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 ^ _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(left[0] ^ right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(left[i] ^ right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_ExclusiveOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt32.cs new file mode 100644 index 00000000000000..5e5d774034f66d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt32.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_ExclusiveOrUInt32() + { + var test = new VectorBinaryOpTest__op_ExclusiveOrUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_ExclusiveOrUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_ExclusiveOrUInt32 testClass) + { + var result = _fld1 ^ _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_ExclusiveOrUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_ExclusiveOrUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) ^ Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_ExclusiveOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 ^ _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 ^ op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_ExclusiveOrUInt32(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 ^ _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(left[0] ^ right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(left[i] ^ right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_ExclusiveOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt64.cs new file mode 100644 index 00000000000000..0e6967f88b0b24 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt64.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_ExclusiveOrUInt64() + { + var test = new VectorBinaryOpTest__op_ExclusiveOrUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_ExclusiveOrUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_ExclusiveOrUInt64 testClass) + { + var result = _fld1 ^ _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_ExclusiveOrUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_ExclusiveOrUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) ^ Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_ExclusiveOr", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 ^ _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 ^ op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_ExclusiveOrUInt64(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 ^ _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 ^ test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(left[0] ^ right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(left[i] ^ right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_ExclusiveOr(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Byte.cs new file mode 100644 index 00000000000000..e49178dd21ba7e --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Byte.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_InequalityByte() + { + var test = new VectorBooleanBinaryOpTest__op_InequalityByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_InequalityByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_InequalityByte testClass) + { + var result = _fld1 != _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_InequalityByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_InequalityByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) != Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Inequality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 != _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 != op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_InequalityByte(); + var result = test._fld1 != test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 != _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 != test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] != right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Inequality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Double.cs new file mode 100644 index 00000000000000..05cb2192da4b08 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Double.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_InequalityDouble() + { + var test = new VectorBooleanBinaryOpTest__op_InequalityDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_InequalityDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_InequalityDouble testClass) + { + var result = _fld1 != _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_InequalityDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_InequalityDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) != Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Inequality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 != _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 != op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_InequalityDouble(); + var result = test._fld1 != test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 != _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 != test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Double[] left, Double[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] != right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Inequality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int16.cs new file mode 100644 index 00000000000000..27f22cad8c89a2 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int16.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_InequalityInt16() + { + var test = new VectorBooleanBinaryOpTest__op_InequalityInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_InequalityInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_InequalityInt16 testClass) + { + var result = _fld1 != _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_InequalityInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_InequalityInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) != Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Inequality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 != _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 != op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_InequalityInt16(); + var result = test._fld1 != test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 != _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 != test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] != right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Inequality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int32.cs new file mode 100644 index 00000000000000..d4c765dd678cc3 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int32.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_InequalityInt32() + { + var test = new VectorBooleanBinaryOpTest__op_InequalityInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_InequalityInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_InequalityInt32 testClass) + { + var result = _fld1 != _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_InequalityInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_InequalityInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) != Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Inequality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 != _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 != op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_InequalityInt32(); + var result = test._fld1 != test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 != _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 != test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] != right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Inequality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int64.cs new file mode 100644 index 00000000000000..c0f1f6d53429e5 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int64.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_InequalityInt64() + { + var test = new VectorBooleanBinaryOpTest__op_InequalityInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_InequalityInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_InequalityInt64 testClass) + { + var result = _fld1 != _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_InequalityInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_InequalityInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) != Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Inequality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 != _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 != op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_InequalityInt64(); + var result = test._fld1 != test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 != _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 != test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] != right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Inequality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.SByte.cs new file mode 100644 index 00000000000000..870cf0a79d1677 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.SByte.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_InequalitySByte() + { + var test = new VectorBooleanBinaryOpTest__op_InequalitySByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_InequalitySByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_InequalitySByte testClass) + { + var result = _fld1 != _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_InequalitySByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_InequalitySByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) != Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Inequality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 != _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 != op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_InequalitySByte(); + var result = test._fld1 != test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 != _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 != test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] != right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Inequality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Single.cs new file mode 100644 index 00000000000000..1a58afc9232417 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Single.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_InequalitySingle() + { + var test = new VectorBooleanBinaryOpTest__op_InequalitySingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_InequalitySingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_InequalitySingle testClass) + { + var result = _fld1 != _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_InequalitySingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_InequalitySingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) != Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Inequality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 != _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 != op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_InequalitySingle(); + var result = test._fld1 != test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 != _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 != test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(Single[] left, Single[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] != right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Inequality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt16.cs new file mode 100644 index 00000000000000..d901d813b714c6 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt16.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_InequalityUInt16() + { + var test = new VectorBooleanBinaryOpTest__op_InequalityUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_InequalityUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_InequalityUInt16 testClass) + { + var result = _fld1 != _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_InequalityUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_InequalityUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) != Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Inequality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 != _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 != op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_InequalityUInt16(); + var result = test._fld1 != test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 != _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 != test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] != right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Inequality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt32.cs new file mode 100644 index 00000000000000..b6afb904dd7abc --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt32.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_InequalityUInt32() + { + var test = new VectorBooleanBinaryOpTest__op_InequalityUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_InequalityUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_InequalityUInt32 testClass) + { + var result = _fld1 != _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_InequalityUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_InequalityUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) != Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Inequality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 != _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 != op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_InequalityUInt32(); + var result = test._fld1 != test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 != _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 != test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] != right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Inequality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt64.cs new file mode 100644 index 00000000000000..ed23dd2251684d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt64.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_InequalityUInt64() + { + var test = new VectorBooleanBinaryOpTest__op_InequalityUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBooleanBinaryOpTest__op_InequalityUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + + private GCHandle inHandle1; + private GCHandle inHandle2; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBooleanBinaryOpTest__op_InequalityUInt64 testClass) + { + var result = _fld1 != _fld2; + testClass.ValidateResult(_fld1, _fld2, result); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBooleanBinaryOpTest__op_InequalityUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBooleanBinaryOpTest__op_InequalityUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) != Unsafe.Read>(_dataTable.inArray2Ptr); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Inequality", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, (bool)(result)); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 != _clsVar2; + ValidateResult(_clsVar1, _clsVar2, result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 != op2; + + ValidateResult(op1, op2, result); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBooleanBinaryOpTest__op_InequalityUInt64(); + var result = test._fld1 != test._fld2; + + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 != _fld2; + + ValidateResult(_fld1, _fld2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 != test._fld2; + ValidateResult(test._fld1, test._fld2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(void* op1, void* op2, bool result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, result, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + var expectedResult = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + expectedResult |= (left[i] != right[i]); + } + + succeeded = (expectedResult == result); + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Inequality(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Byte.cs new file mode 100644 index 00000000000000..a0721548fc9592 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Byte.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_MultiplyByte() + { + var test = new VectorBinaryOpTest__op_MultiplyByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_MultiplyByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_MultiplyByte testClass) + { + var result = _fld1 * _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_MultiplyByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_MultiplyByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) * Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Multiply", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 * _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 * op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_MultiplyByte(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 * _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Multiply(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Double.cs new file mode 100644 index 00000000000000..b66062437a9bb4 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Double.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_MultiplyDouble() + { + var test = new VectorBinaryOpTest__op_MultiplyDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_MultiplyDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_MultiplyDouble testClass) + { + var result = _fld1 * _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_MultiplyDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_MultiplyDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) * Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Multiply", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 * _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 * op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_MultiplyDouble(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 * _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (double)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (double)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Multiply(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int16.cs new file mode 100644 index 00000000000000..4254a6faff9f91 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int16.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_MultiplyInt16() + { + var test = new VectorBinaryOpTest__op_MultiplyInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_MultiplyInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_MultiplyInt16 testClass) + { + var result = _fld1 * _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_MultiplyInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_MultiplyInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) * Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Multiply", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 * _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 * op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_MultiplyInt16(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 * _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Multiply(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int32.cs new file mode 100644 index 00000000000000..9cf9b5da51624e --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int32.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_MultiplyInt32() + { + var test = new VectorBinaryOpTest__op_MultiplyInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_MultiplyInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_MultiplyInt32 testClass) + { + var result = _fld1 * _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_MultiplyInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_MultiplyInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) * Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Multiply", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 * _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 * op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_MultiplyInt32(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 * _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Multiply(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int64.cs new file mode 100644 index 00000000000000..ef2ee230de0bbd --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int64.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_MultiplyInt64() + { + var test = new VectorBinaryOpTest__op_MultiplyInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_MultiplyInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_MultiplyInt64 testClass) + { + var result = _fld1 * _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_MultiplyInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_MultiplyInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) * Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Multiply", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 * _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 * op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_MultiplyInt64(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 * _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Multiply(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.SByte.cs new file mode 100644 index 00000000000000..5b3ceba9c70e79 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.SByte.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_MultiplySByte() + { + var test = new VectorBinaryOpTest__op_MultiplySByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_MultiplySByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_MultiplySByte testClass) + { + var result = _fld1 * _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_MultiplySByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_MultiplySByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) * Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Multiply", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 * _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 * op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_MultiplySByte(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 * _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Multiply(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Single.cs new file mode 100644 index 00000000000000..fcf8493c1906bf --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Single.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_MultiplySingle() + { + var test = new VectorBinaryOpTest__op_MultiplySingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_MultiplySingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_MultiplySingle testClass) + { + var result = _fld1 * _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_MultiplySingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_MultiplySingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) * Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Multiply", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 * _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 * op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_MultiplySingle(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 * _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (float)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (float)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Multiply(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt16.cs new file mode 100644 index 00000000000000..c5e1b4e7c44bda --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt16.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_MultiplyUInt16() + { + var test = new VectorBinaryOpTest__op_MultiplyUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_MultiplyUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_MultiplyUInt16 testClass) + { + var result = _fld1 * _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_MultiplyUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_MultiplyUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) * Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Multiply", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 * _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 * op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_MultiplyUInt16(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 * _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Multiply(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt32.cs new file mode 100644 index 00000000000000..4492d7ead29c98 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt32.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_MultiplyUInt32() + { + var test = new VectorBinaryOpTest__op_MultiplyUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_MultiplyUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_MultiplyUInt32 testClass) + { + var result = _fld1 * _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_MultiplyUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_MultiplyUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) * Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Multiply", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 * _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 * op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_MultiplyUInt32(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 * _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Multiply(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt64.cs new file mode 100644 index 00000000000000..4b856063150600 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt64.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_MultiplyUInt64() + { + var test = new VectorBinaryOpTest__op_MultiplyUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_MultiplyUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_MultiplyUInt64 testClass) + { + var result = _fld1 * _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_MultiplyUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_MultiplyUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) * Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Multiply", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 * _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 * op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_MultiplyUInt64(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 * _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 * test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(left[0] * right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(left[i] * right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Multiply(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Byte.cs new file mode 100644 index 00000000000000..9122b1f46583e4 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Byte.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_OnesComplementByte() + { + var test = new VectorUnaryOpTest__op_OnesComplementByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_OnesComplementByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_OnesComplementByte testClass) + { + var result = ~_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_OnesComplementByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_OnesComplementByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = ~Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_OnesComplement", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = ~_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = ~op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_OnesComplementByte(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = ~_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Byte[] firstOp, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(~firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(~firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_OnesComplement(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Double.cs new file mode 100644 index 00000000000000..4ba10fe2cbce0b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Double.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_OnesComplementDouble() + { + var test = new VectorUnaryOpTest__op_OnesComplementDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_OnesComplementDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_OnesComplementDouble testClass) + { + var result = ~_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_OnesComplementDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_OnesComplementDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = ~Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_OnesComplement", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = ~_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = ~op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_OnesComplementDouble(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = ~_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.DoubleToInt64Bits(result[0]) != ~BitConverter.DoubleToInt64Bits(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(result[i]) != ~BitConverter.DoubleToInt64Bits(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_OnesComplement(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int16.cs new file mode 100644 index 00000000000000..6fd821763094c1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int16.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_OnesComplementInt16() + { + var test = new VectorUnaryOpTest__op_OnesComplementInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_OnesComplementInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_OnesComplementInt16 testClass) + { + var result = ~_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_OnesComplementInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_OnesComplementInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = ~Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_OnesComplement", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = ~_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = ~op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_OnesComplementInt16(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = ~_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(~firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(~firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_OnesComplement(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int32.cs new file mode 100644 index 00000000000000..86fb893323cee0 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int32.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_OnesComplementInt32() + { + var test = new VectorUnaryOpTest__op_OnesComplementInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_OnesComplementInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_OnesComplementInt32 testClass) + { + var result = ~_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_OnesComplementInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_OnesComplementInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = ~Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_OnesComplement", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = ~_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = ~op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_OnesComplementInt32(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = ~_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(~firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(~firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_OnesComplement(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int64.cs new file mode 100644 index 00000000000000..c073777e8f7283 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int64.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_OnesComplementInt64() + { + var test = new VectorUnaryOpTest__op_OnesComplementInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_OnesComplementInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_OnesComplementInt64 testClass) + { + var result = ~_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_OnesComplementInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_OnesComplementInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = ~Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_OnesComplement", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = ~_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = ~op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_OnesComplementInt64(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = ~_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int64[] firstOp, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(~firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(~firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_OnesComplement(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.SByte.cs new file mode 100644 index 00000000000000..4c958dcddae258 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.SByte.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_OnesComplementSByte() + { + var test = new VectorUnaryOpTest__op_OnesComplementSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_OnesComplementSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_OnesComplementSByte testClass) + { + var result = ~_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_OnesComplementSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_OnesComplementSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = ~Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_OnesComplement", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = ~_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = ~op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_OnesComplementSByte(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = ~_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(SByte[] firstOp, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(~firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(~firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_OnesComplement(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Single.cs new file mode 100644 index 00000000000000..4a12b648f33c2f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Single.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_OnesComplementSingle() + { + var test = new VectorUnaryOpTest__op_OnesComplementSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_OnesComplementSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_OnesComplementSingle testClass) + { + var result = ~_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_OnesComplementSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_OnesComplementSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = ~Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_OnesComplement", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = ~_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = ~op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_OnesComplementSingle(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = ~_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (BitConverter.SingleToInt32Bits(result[0]) != ~BitConverter.SingleToInt32Bits(firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(result[i]) != ~BitConverter.SingleToInt32Bits(firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_OnesComplement(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt16.cs new file mode 100644 index 00000000000000..b382b60b46f14b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt16.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_OnesComplementUInt16() + { + var test = new VectorUnaryOpTest__op_OnesComplementUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_OnesComplementUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_OnesComplementUInt16 testClass) + { + var result = ~_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_OnesComplementUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_OnesComplementUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = ~Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_OnesComplement", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = ~_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = ~op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_OnesComplementUInt16(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = ~_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt16[] firstOp, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(~firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(~firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_OnesComplement(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt32.cs new file mode 100644 index 00000000000000..b9930754852c90 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt32.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_OnesComplementUInt32() + { + var test = new VectorUnaryOpTest__op_OnesComplementUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_OnesComplementUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_OnesComplementUInt32 testClass) + { + var result = ~_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_OnesComplementUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_OnesComplementUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = ~Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_OnesComplement", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = ~_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = ~op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_OnesComplementUInt32(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = ~_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(~firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(~firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_OnesComplement(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt64.cs new file mode 100644 index 00000000000000..3a54dd09b54cbf --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt64.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_OnesComplementUInt64() + { + var test = new VectorUnaryOpTest__op_OnesComplementUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_OnesComplementUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_OnesComplementUInt64 testClass) + { + var result = ~_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_OnesComplementUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_OnesComplementUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = ~Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_OnesComplement", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = ~_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = ~op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_OnesComplementUInt64(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = ~_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = ~test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt64[] firstOp, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(~firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(~firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_OnesComplement(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Byte.cs new file mode 100644 index 00000000000000..70915763174517 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Byte.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_SubtractionByte() + { + var test = new VectorBinaryOpTest__op_SubtractionByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_SubtractionByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_SubtractionByte testClass) + { + var result = _fld1 - _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_SubtractionByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_SubtractionByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) - Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Subtraction", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 - _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 - op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_SubtractionByte(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 - _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Subtraction(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Double.cs new file mode 100644 index 00000000000000..6bd5ef40c0e8d6 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Double.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_SubtractionDouble() + { + var test = new VectorBinaryOpTest__op_SubtractionDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_SubtractionDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_SubtractionDouble testClass) + { + var result = _fld1 - _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_SubtractionDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_SubtractionDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) - Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Subtraction", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 - _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 - op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_SubtractionDouble(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 - _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] left, Double[] right, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (double)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (double)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Subtraction(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int16.cs new file mode 100644 index 00000000000000..31bf90038ae5bf --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int16.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_SubtractionInt16() + { + var test = new VectorBinaryOpTest__op_SubtractionInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_SubtractionInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_SubtractionInt16 testClass) + { + var result = _fld1 - _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_SubtractionInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_SubtractionInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) - Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Subtraction", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 - _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 - op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_SubtractionInt16(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 - _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] left, Int16[] right, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Subtraction(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int32.cs new file mode 100644 index 00000000000000..9e164aea13811a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int32.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_SubtractionInt32() + { + var test = new VectorBinaryOpTest__op_SubtractionInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_SubtractionInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_SubtractionInt32 testClass) + { + var result = _fld1 - _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_SubtractionInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_SubtractionInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) - Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Subtraction", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 - _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 - op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_SubtractionInt32(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 - _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Subtraction(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int64.cs new file mode 100644 index 00000000000000..dfe277f421207a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int64.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_SubtractionInt64() + { + var test = new VectorBinaryOpTest__op_SubtractionInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_SubtractionInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_SubtractionInt64 testClass) + { + var result = _fld1 - _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_SubtractionInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_SubtractionInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) - Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Subtraction", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 - _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 - op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_SubtractionInt64(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 - _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] left, Int64[] right, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Subtraction(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.SByte.cs new file mode 100644 index 00000000000000..671a5373f3d979 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.SByte.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_SubtractionSByte() + { + var test = new VectorBinaryOpTest__op_SubtractionSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_SubtractionSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_SubtractionSByte testClass) + { + var result = _fld1 - _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_SubtractionSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_SubtractionSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) - Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Subtraction", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 - _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 - op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_SubtractionSByte(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 - _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Subtraction(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Single.cs new file mode 100644 index 00000000000000..b3d6809121d4bf --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Single.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_SubtractionSingle() + { + var test = new VectorBinaryOpTest__op_SubtractionSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_SubtractionSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_SubtractionSingle testClass) + { + var result = _fld1 - _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_SubtractionSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_SubtractionSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) - Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Subtraction", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 - _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 - op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_SubtractionSingle(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 - _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (float)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (float)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Subtraction(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt16.cs new file mode 100644 index 00000000000000..af91111a9aae09 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt16.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_SubtractionUInt16() + { + var test = new VectorBinaryOpTest__op_SubtractionUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_SubtractionUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_SubtractionUInt16 testClass) + { + var result = _fld1 - _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_SubtractionUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_SubtractionUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) - Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Subtraction", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 - _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 - op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_SubtractionUInt16(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 - _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Subtraction(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt32.cs new file mode 100644 index 00000000000000..f64d3d6f4b133c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt32.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_SubtractionUInt32() + { + var test = new VectorBinaryOpTest__op_SubtractionUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_SubtractionUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_SubtractionUInt32 testClass) + { + var result = _fld1 - _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_SubtractionUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_SubtractionUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) - Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Subtraction", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 - _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 - op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_SubtractionUInt32(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 - _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Subtraction(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt64.cs new file mode 100644 index 00000000000000..0df590f17a1c80 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt64.cs @@ -0,0 +1,323 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_SubtractionUInt64() + { + var test = new VectorBinaryOpTest__op_SubtractionUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorBinaryOpTest__op_SubtractionUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + public Vector512 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorBinaryOpTest__op_SubtractionUInt64 testClass) + { + var result = _fld1 - _fld2; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector512 _clsVar1; + private static Vector512 _clsVar2; + + private Vector512 _fld1; + private Vector512 _fld2; + + private DataTable _dataTable; + + static VectorBinaryOpTest__op_SubtractionUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorBinaryOpTest__op_SubtractionUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Unsafe.Read>(_dataTable.inArray1Ptr) - Unsafe.Read>(_dataTable.inArray2Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_Subtraction", new Type[] { typeof(Vector512), typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = _clsVar1 - _clsVar2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var result = op1 - op2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorBinaryOpTest__op_SubtractionUInt64(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = _fld1 - _fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = test._fld1 - test._fld2; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, Vector512 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(left[0] - right[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(left[i] - right[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_Subtraction(Vector512, Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Byte.cs new file mode 100644 index 00000000000000..e4d76fed1a5004 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Byte.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryNegationByte() + { + var test = new VectorUnaryOpTest__op_UnaryNegationByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryNegationByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryNegationByte testClass) + { + var result = -_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryNegationByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryNegationByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = -Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryNegation", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = -_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = -op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryNegationByte(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = -_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Byte[] firstOp, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryNegation(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Double.cs new file mode 100644 index 00000000000000..da803a098be93e --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Double.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryNegationDouble() + { + var test = new VectorUnaryOpTest__op_UnaryNegationDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryNegationDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryNegationDouble testClass) + { + var result = -_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryNegationDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryNegationDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = -Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryNegation", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = -_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = -op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryNegationDouble(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = -_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (double)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (double)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryNegation(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int16.cs new file mode 100644 index 00000000000000..995fc1301e5cc9 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int16.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryNegationInt16() + { + var test = new VectorUnaryOpTest__op_UnaryNegationInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryNegationInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryNegationInt16 testClass) + { + var result = -_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryNegationInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryNegationInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = -Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryNegation", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = -_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = -op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryNegationInt16(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = -_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryNegation(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int32.cs new file mode 100644 index 00000000000000..f61675050e83d5 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int32.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryNegationInt32() + { + var test = new VectorUnaryOpTest__op_UnaryNegationInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryNegationInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryNegationInt32 testClass) + { + var result = -_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryNegationInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryNegationInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = -Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryNegation", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = -_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = -op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryNegationInt32(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = -_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryNegation(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int64.cs new file mode 100644 index 00000000000000..7a3024e3cbc6e8 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int64.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryNegationInt64() + { + var test = new VectorUnaryOpTest__op_UnaryNegationInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryNegationInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryNegationInt64 testClass) + { + var result = -_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryNegationInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryNegationInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = -Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryNegation", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = -_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = -op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryNegationInt64(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = -_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int64[] firstOp, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryNegation(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.SByte.cs new file mode 100644 index 00000000000000..22b5eb2ad8a5ee --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.SByte.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryNegationSByte() + { + var test = new VectorUnaryOpTest__op_UnaryNegationSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryNegationSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryNegationSByte testClass) + { + var result = -_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryNegationSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryNegationSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = -Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryNegation", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = -_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = -op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryNegationSByte(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = -_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(SByte[] firstOp, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryNegation(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Single.cs new file mode 100644 index 00000000000000..206a04b28263f2 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Single.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryNegationSingle() + { + var test = new VectorUnaryOpTest__op_UnaryNegationSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryNegationSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryNegationSingle testClass) + { + var result = -_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryNegationSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryNegationSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = -Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryNegation", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = -_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = -op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryNegationSingle(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = -_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (float)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (float)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryNegation(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt16.cs new file mode 100644 index 00000000000000..594a5e1e4a9010 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt16.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryNegationUInt16() + { + var test = new VectorUnaryOpTest__op_UnaryNegationUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryNegationUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryNegationUInt16 testClass) + { + var result = -_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryNegationUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryNegationUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = -Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryNegation", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = -_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = -op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryNegationUInt16(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = -_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt16[] firstOp, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryNegation(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt32.cs new file mode 100644 index 00000000000000..638f66e766109f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt32.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryNegationUInt32() + { + var test = new VectorUnaryOpTest__op_UnaryNegationUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryNegationUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryNegationUInt32 testClass) + { + var result = -_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryNegationUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryNegationUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = -Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryNegation", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = -_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = -op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryNegationUInt32(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = -_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryNegation(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt64.cs new file mode 100644 index 00000000000000..a3977f0148bc61 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt64.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryNegationUInt64() + { + var test = new VectorUnaryOpTest__op_UnaryNegationUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryNegationUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryNegationUInt64 testClass) + { + var result = -_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryNegationUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryNegationUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = -Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryNegation", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = -_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = -op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryNegationUInt64(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = -_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = -test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt64[] firstOp, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(0 - firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(0 - firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryNegation(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Byte.cs new file mode 100644 index 00000000000000..c89475bb25a4ac --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Byte.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryPlusByte() + { + var test = new VectorUnaryOpTest__op_UnaryPlusByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryPlusByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryPlusByte testClass) + { + var result = +_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Byte); + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryPlusByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryPlusByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, new Byte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = +Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryPlus", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = +_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = +op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryPlusByte(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = +_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Byte[] firstOp, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (byte)(+firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (byte)(+firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryPlus(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Double.cs new file mode 100644 index 00000000000000..fb83e33491e720 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Double.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryPlusDouble() + { + var test = new VectorUnaryOpTest__op_UnaryPlusDouble(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryPlusDouble + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryPlusDouble testClass) + { + var result = +_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Double); + + private static Double[] _data1 = new Double[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryPlusDouble() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryPlusDouble() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, new Double[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = +Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryPlus", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = +_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = +op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryPlusDouble(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = +_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (double)(+firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (double)(+firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryPlus(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int16.cs new file mode 100644 index 00000000000000..5f5cb7989c97e4 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int16.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryPlusInt16() + { + var test = new VectorUnaryOpTest__op_UnaryPlusInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryPlusInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryPlusInt16 testClass) + { + var result = +_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryPlusInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryPlusInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, new Int16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = +Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryPlus", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = +_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = +op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryPlusInt16(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = +_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (short)(+firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (short)(+firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryPlus(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int32.cs new file mode 100644 index 00000000000000..345c16617698d2 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int32.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryPlusInt32() + { + var test = new VectorUnaryOpTest__op_UnaryPlusInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryPlusInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryPlusInt32 testClass) + { + var result = +_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryPlusInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryPlusInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, new Int32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = +Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryPlus", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = +_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = +op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryPlusInt32(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = +_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (int)(+firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (int)(+firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryPlus(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int64.cs new file mode 100644 index 00000000000000..ebb2e47a1c506b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int64.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryPlusInt64() + { + var test = new VectorUnaryOpTest__op_UnaryPlusInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryPlusInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryPlusInt64 testClass) + { + var result = +_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int64); + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryPlusInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryPlusInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, new Int64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = +Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryPlus", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = +_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = +op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryPlusInt64(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = +_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Int64[] firstOp, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (long)(+firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (long)(+firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryPlus(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.SByte.cs new file mode 100644 index 00000000000000..13081b5b0c8901 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.SByte.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryPlusSByte() + { + var test = new VectorUnaryOpTest__op_UnaryPlusSByte(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryPlusSByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryPlusSByte testClass) + { + var result = +_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(SByte); + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryPlusSByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryPlusSByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, new SByte[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = +Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryPlus", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = +_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = +op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryPlusSByte(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = +_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(SByte[] firstOp, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (sbyte)(+firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (sbyte)(+firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryPlus(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Single.cs new file mode 100644 index 00000000000000..bd9cf9188e8099 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Single.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryPlusSingle() + { + var test = new VectorUnaryOpTest__op_UnaryPlusSingle(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryPlusSingle + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryPlusSingle testClass) + { + var result = +_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); + + private static Single[] _data1 = new Single[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryPlusSingle() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryPlusSingle() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, new Single[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = +Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryPlus", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = +_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = +op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryPlusSingle(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = +_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (float)(+firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (float)(+firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryPlus(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt16.cs new file mode 100644 index 00000000000000..f627a6148fca44 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt16.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryPlusUInt16() + { + var test = new VectorUnaryOpTest__op_UnaryPlusUInt16(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryPlusUInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryPlusUInt16 testClass) + { + var result = +_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryPlusUInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryPlusUInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = +Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryPlus", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = +_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = +op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryPlusUInt16(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = +_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt16[] firstOp, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ushort)(+firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ushort)(+firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryPlus(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt32.cs new file mode 100644 index 00000000000000..6db91514fd7350 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt32.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryPlusUInt32() + { + var test = new VectorUnaryOpTest__op_UnaryPlusUInt32(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryPlusUInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryPlusUInt32 testClass) + { + var result = +_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryPlusUInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryPlusUInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = +Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryPlus", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = +_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = +op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryPlusUInt32(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = +_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (uint)(+firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (uint)(+firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryPlus(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt64.cs new file mode 100644 index 00000000000000..0b08df7dc0b226 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt64.cs @@ -0,0 +1,296 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * 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 Xunit; + +namespace JIT.HardwareIntrinsics.General._Vector512_1 +{ + public static partial class Program + { + [Fact] + public static void op_UnaryPlusUInt64() + { + var test = new VectorUnaryOpTest__op_UnaryPlusUInt64(); + + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a static member works + test.RunClsVarScenario(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class VectorUnaryOpTest__op_UnaryPlusUInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector512 _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(VectorUnaryOpTest__op_UnaryPlusUInt64 testClass) + { + var result = +_fld1; + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = 64; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + + private static Vector512 _clsVar1; + + private Vector512 _fld1; + + private DataTable _dataTable; + + static VectorUnaryOpTest__op_UnaryPlusUInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + } + + public VectorUnaryOpTest__op_UnaryPlusUInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = +Unsafe.Read>(_dataTable.inArray1Ptr); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Vector512).GetMethod("op_UnaryPlus", new Type[] { typeof(Vector512) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector512)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = +_clsVar1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var result = +op1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new VectorUnaryOpTest__op_UnaryPlusUInt64(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = +_fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = +test._fld1; + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + private void ValidateResult(Vector512 op1, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(UInt64[] firstOp, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (result[0] != (ulong)(+firstOp[0])) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != (ulong)(+firstOp[i])) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Vector512)}.op_UnaryPlus(Vector512): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} From 05257599f4e5c8b38a58888417e0e9beab02e1ca Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Fri, 11 Nov 2022 13:04:23 -0800 Subject: [PATCH 07/26] Ensure the ref assembly is up to date --- .../System/Runtime/Intrinsics/Vector512.cs | 1 + .../ref/System.Runtime.Intrinsics.cs | 36 ++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs index 9034a1e5de4a39..9b7be1d777fb67 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs @@ -1162,6 +1162,7 @@ public static Vector512 Create(Vector256 lower, Vector256 upper) /// The value that the lower 256-bits will be initialized to. /// The value that the upper 256-bits will be initialized to. /// A new initialized from and . + [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector512 Create(Vector256 lower, Vector256 upper) => Create(lower, upper); diff --git a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs index 7efc7855fbb9b4..2058c20ba684a7 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -722,6 +722,9 @@ public static void CopyTo(this System.Runtime.Intrinsics.Vector512 vector, public static System.Runtime.Intrinsics.Vector512 Create(System.Runtime.Intrinsics.Vector256 lower, System.Runtime.Intrinsics.Vector256 upper) { throw null; } public static System.Runtime.Intrinsics.Vector512 Create(System.Runtime.Intrinsics.Vector256 lower, System.Runtime.Intrinsics.Vector256 upper) { throw null; } public static System.Runtime.Intrinsics.Vector512 Create(System.Runtime.Intrinsics.Vector256 lower, System.Runtime.Intrinsics.Vector256 upper) { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(System.Runtime.Intrinsics.Vector256 lower, System.Runtime.Intrinsics.Vector256 upper) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 Create(System.Runtime.Intrinsics.Vector256 lower, System.Runtime.Intrinsics.Vector256 upper) { throw null; } [System.CLSCompliantAttribute(false)] public static System.Runtime.Intrinsics.Vector512 Create(System.Runtime.Intrinsics.Vector256 lower, System.Runtime.Intrinsics.Vector256 upper) { throw null; } public static System.Runtime.Intrinsics.Vector512 Create(System.Runtime.Intrinsics.Vector256 lower, System.Runtime.Intrinsics.Vector256 upper) { throw null; } @@ -766,6 +769,7 @@ public static void CopyTo(this System.Runtime.Intrinsics.Vector512 vector, public static System.Runtime.Intrinsics.Vector512 CreateScalar(uint value) { throw null; } [System.CLSCompliantAttribute(false)] public static System.Runtime.Intrinsics.Vector512 CreateScalar(ulong value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 CreateScalar(T value) where T: struct { throw null; } public static System.Runtime.Intrinsics.Vector512 CreateScalarUnsafe(byte value) { throw null; } public static System.Runtime.Intrinsics.Vector512 CreateScalarUnsafe(double value) { throw null; } public static System.Runtime.Intrinsics.Vector512 CreateScalarUnsafe(short value) { throw null; } @@ -783,11 +787,14 @@ public static void CopyTo(this System.Runtime.Intrinsics.Vector512 vector, public static System.Runtime.Intrinsics.Vector512 CreateScalarUnsafe(uint value) { throw null; } [System.CLSCompliantAttribute(false)] public static System.Runtime.Intrinsics.Vector512 CreateScalarUnsafe(ulong value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 CreateScalarUnsafe(T value) where T: struct { throw null; } public static System.Runtime.Intrinsics.Vector512 Create(System.ReadOnlySpan values) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 Create(System.Runtime.Intrinsics.Vector256 lower, System.Runtime.Intrinsics.Vector256 upper) where T : struct { throw null; } public static System.Runtime.Intrinsics.Vector512 Create(T value) where T : struct { throw null; } public static System.Runtime.Intrinsics.Vector512 Create(T[] values) where T : struct { throw null; } public static System.Runtime.Intrinsics.Vector512 Create(T[] values, int index) where T : struct { throw null; } public static System.Runtime.Intrinsics.Vector512 Divide(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } + public static System.Runtime.Intrinsics.Vector512 Divide(System.Runtime.Intrinsics.Vector512 left, T right) where T : struct { throw null; } public static T Dot(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } public static bool EqualsAll(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } public static bool EqualsAny(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) where T : struct { throw null; } @@ -913,6 +920,28 @@ public static void CopyTo(this System.Runtime.Intrinsics.Vector512 vector, public static (System.Runtime.Intrinsics.Vector512 Lower, System.Runtime.Intrinsics.Vector512 Upper) Widen(System.Runtime.Intrinsics.Vector512 source) { throw null; } [System.CLSCompliantAttribute(false)] public static (System.Runtime.Intrinsics.Vector512 Lower, System.Runtime.Intrinsics.Vector512 Upper) Widen(System.Runtime.Intrinsics.Vector512 source) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 WidenLower(System.Runtime.Intrinsics.Vector512 source) { throw null; } + public static System.Runtime.Intrinsics.Vector512 WidenLower(System.Runtime.Intrinsics.Vector512 source) { throw null; } + public static System.Runtime.Intrinsics.Vector512 WidenLower(System.Runtime.Intrinsics.Vector512 source) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 WidenLower(System.Runtime.Intrinsics.Vector512 source) { throw null; } + public static System.Runtime.Intrinsics.Vector512 WidenLower(System.Runtime.Intrinsics.Vector512 source) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 WidenLower(System.Runtime.Intrinsics.Vector512 source) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 WidenLower(System.Runtime.Intrinsics.Vector512 source) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 WidenUpper(System.Runtime.Intrinsics.Vector512 source) { throw null; } + public static System.Runtime.Intrinsics.Vector512 WidenUpper(System.Runtime.Intrinsics.Vector512 source) { throw null; } + public static System.Runtime.Intrinsics.Vector512 WidenUpper(System.Runtime.Intrinsics.Vector512 source) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 WidenUpper(System.Runtime.Intrinsics.Vector512 source) { throw null; } + public static System.Runtime.Intrinsics.Vector512 WidenUpper(System.Runtime.Intrinsics.Vector512 source) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 WidenUpper(System.Runtime.Intrinsics.Vector512 source) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Runtime.Intrinsics.Vector512 WidenUpper(System.Runtime.Intrinsics.Vector512 source) { throw null; } public static System.Runtime.Intrinsics.Vector512 WithElement(this System.Runtime.Intrinsics.Vector512 vector, int index, T value) where T : struct { throw null; } public static System.Runtime.Intrinsics.Vector512 WithLower(this System.Runtime.Intrinsics.Vector512 vector, System.Runtime.Intrinsics.Vector256 value) where T : struct { throw null; } public static System.Runtime.Intrinsics.Vector512 WithUpper(this System.Runtime.Intrinsics.Vector512 vector, System.Runtime.Intrinsics.Vector256 value) where T : struct { throw null; } @@ -922,8 +951,9 @@ public static void CopyTo(this System.Runtime.Intrinsics.Vector512 vector, { private readonly int _dummyPrimitive; public static System.Runtime.Intrinsics.Vector512 AllBitsSet { get { throw null; } } - public static bool IsSupported { get { throw null; } } public static int Count { get { throw null; } } + public static bool IsSupported { get { throw null; } } + public static System.Runtime.Intrinsics.Vector512 One { get { throw null; } } public static System.Runtime.Intrinsics.Vector512 Zero { get { throw null; } } public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public bool Equals(System.Runtime.Intrinsics.Vector512 other) { throw null; } @@ -933,16 +963,20 @@ public static void CopyTo(this System.Runtime.Intrinsics.Vector512 vector, public static System.Runtime.Intrinsics.Vector512 operator &(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } public static System.Runtime.Intrinsics.Vector512 operator |(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } public static System.Runtime.Intrinsics.Vector512 operator /(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } + public static System.Runtime.Intrinsics.Vector512 operator /(System.Runtime.Intrinsics.Vector512 left, T right) { throw null; } public static bool operator ==(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } public static System.Runtime.Intrinsics.Vector512 operator ^(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } public static bool operator !=(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } + public static System.Runtime.Intrinsics.Vector512 operator <<(System.Runtime.Intrinsics.Vector512 value, int shiftCount) { throw null; } public static System.Runtime.Intrinsics.Vector512 operator *(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } public static System.Runtime.Intrinsics.Vector512 operator *(System.Runtime.Intrinsics.Vector512 left, T right) { throw null; } public static System.Runtime.Intrinsics.Vector512 operator *(T left, System.Runtime.Intrinsics.Vector512 right) { throw null; } public static System.Runtime.Intrinsics.Vector512 operator ~(System.Runtime.Intrinsics.Vector512 vector) { throw null; } + public static System.Runtime.Intrinsics.Vector512 operator >>(System.Runtime.Intrinsics.Vector512 value, int shiftCount) { throw null; } public static System.Runtime.Intrinsics.Vector512 operator -(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } public static System.Runtime.Intrinsics.Vector512 operator -(System.Runtime.Intrinsics.Vector512 vector) { throw null; } public static System.Runtime.Intrinsics.Vector512 operator +(System.Runtime.Intrinsics.Vector512 value) { throw null; } + public static System.Runtime.Intrinsics.Vector512 operator >>>(System.Runtime.Intrinsics.Vector512 value, int shiftCount) { throw null; } public override string ToString() { throw null; } } public static partial class Vector64 From 35f01e1dcd0f79cc1a81e03c39084033e4499b04 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Fri, 11 Nov 2022 13:17:13 -0800 Subject: [PATCH 08/26] Fixing a couple JIT asserts --- src/coreclr/jit/hwintrinsicarm64.cpp | 23 +++++++++++++++++------ src/coreclr/jit/hwintrinsicxarch.cpp | 25 ++++++++++++++++++------- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/src/coreclr/jit/hwintrinsicarm64.cpp b/src/coreclr/jit/hwintrinsicarm64.cpp index e4653df3e6d6b1..7eb9b051fae643 100644 --- a/src/coreclr/jit/hwintrinsicarm64.cpp +++ b/src/coreclr/jit/hwintrinsicarm64.cpp @@ -806,14 +806,25 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, { assert(sig->numArgs == 2); - if (varTypeIsFloating(simdBaseType)) + if (!varTypeIsFloating(simdBaseType)) { - op2 = impSIMDPopStack(retType); - op1 = impSIMDPopStack(retType); - - retNode = gtNewSimdBinOpNode(GT_DIV, retType, op1, op2, simdBaseJitType, simdSize, - /* isSimdAsHWIntrinsic */ false); + // We can't trivially handle division for integral types using SIMD + break; } + + CORINFO_ARG_LIST_HANDLE arg1 = sig->args; + CORINFO_ARG_LIST_HANDLE arg2 = info.compCompHnd->getArgNext(arg1); + var_types argType = TYP_UNKNOWN; + CORINFO_CLASS_HANDLE argClass = NO_CLASS_HANDLE; + + argType = JITtype2varType(strip(info.compCompHnd->getArgType(sig, arg2, &argClass))); + op2 = getArgForHWIntrinsic(argType, argClass); + + argType = JITtype2varType(strip(info.compCompHnd->getArgType(sig, arg1, &argClass))); + op1 = getArgForHWIntrinsic(argType, argClass); + + retNode = gtNewSimdBinOpNode(GT_DIV, retType, op1, op2, simdBaseJitType, simdSize, + /* isSimdAsHWIntrinsic */ false); break; } diff --git a/src/coreclr/jit/hwintrinsicxarch.cpp b/src/coreclr/jit/hwintrinsicxarch.cpp index 8eea6cb6c1af23..e28d910b80415d 100644 --- a/src/coreclr/jit/hwintrinsicxarch.cpp +++ b/src/coreclr/jit/hwintrinsicxarch.cpp @@ -1148,14 +1148,25 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic intrinsic, { assert(sig->numArgs == 2); - if (varTypeIsFloating(simdBaseType)) + if (!varTypeIsFloating(simdBaseType)) { - op2 = impSIMDPopStack(retType); - op1 = impSIMDPopStack(retType); - - retNode = gtNewSimdBinOpNode(GT_DIV, retType, op1, op2, simdBaseJitType, simdSize, - /* isSimdAsHWIntrinsic */ false); + // We can't trivially handle division for integral types using SIMD + break; } + + CORINFO_ARG_LIST_HANDLE arg1 = sig->args; + CORINFO_ARG_LIST_HANDLE arg2 = info.compCompHnd->getArgNext(arg1); + var_types argType = TYP_UNKNOWN; + CORINFO_CLASS_HANDLE argClass = NO_CLASS_HANDLE; + + argType = JITtype2varType(strip(info.compCompHnd->getArgType(sig, arg2, &argClass))); + op2 = getArgForHWIntrinsic(argType, argClass); + + argType = JITtype2varType(strip(info.compCompHnd->getArgType(sig, arg1, &argClass))); + op1 = getArgForHWIntrinsic(argType, argClass); + + retNode = gtNewSimdBinOpNode(GT_DIV, retType, op1, op2, simdBaseJitType, simdSize, + /* isSimdAsHWIntrinsic */ false); break; } @@ -2080,7 +2091,7 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic intrinsic, { assert(sig->numArgs == 2); - if (varTypeIsByte(simdBaseType) || varTypeIsLong(simdBaseType)) + if (varTypeIsByte(simdBaseType) || varTypeIsLong(simdBaseType) || (simdBaseType == TYP_DOUBLE)) { // byte, sbyte, long, and ulong would require more work to support break; From bc8b4979352562b50904994de5c0b2854e64925a Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Fri, 11 Nov 2022 14:24:51 -0800 Subject: [PATCH 09/26] Fixing tests to pass the right number of constructor parameters --- .../General/Shared/GenerateTests.csx | 160 +++++++++--------- .../General/Vector512/CreateElement.Byte.cs | 4 +- .../General/Vector512/CreateElement.Double.cs | 4 +- .../General/Vector512/CreateElement.Int16.cs | 4 +- .../General/Vector512/CreateElement.Int32.cs | 4 +- .../General/Vector512/CreateElement.Int64.cs | 4 +- .../General/Vector512/CreateElement.SByte.cs | 4 +- .../General/Vector512/CreateElement.Single.cs | 4 +- .../General/Vector512/CreateElement.UInt16.cs | 4 +- .../General/Vector512/CreateElement.UInt32.cs | 4 +- .../General/Vector512/CreateElement.UInt64.cs | 4 +- .../Vector512_1/GetAndWithElement.Byte.0.cs | 4 +- .../Vector512_1/GetAndWithElement.Byte.15.cs | 4 +- .../Vector512_1/GetAndWithElement.Byte.31.cs | 4 +- .../Vector512_1/GetAndWithElement.Byte.7.cs | 4 +- .../Vector512_1/GetAndWithElement.Double.0.cs | 4 +- .../Vector512_1/GetAndWithElement.Double.1.cs | 4 +- .../Vector512_1/GetAndWithElement.Double.3.cs | 4 +- .../Vector512_1/GetAndWithElement.Int16.0.cs | 4 +- .../Vector512_1/GetAndWithElement.Int16.15.cs | 4 +- .../Vector512_1/GetAndWithElement.Int16.3.cs | 4 +- .../Vector512_1/GetAndWithElement.Int16.7.cs | 4 +- .../Vector512_1/GetAndWithElement.Int32.0.cs | 4 +- .../Vector512_1/GetAndWithElement.Int32.1.cs | 4 +- .../Vector512_1/GetAndWithElement.Int32.3.cs | 4 +- .../Vector512_1/GetAndWithElement.Int32.7.cs | 4 +- .../Vector512_1/GetAndWithElement.Int64.0.cs | 4 +- .../Vector512_1/GetAndWithElement.Int64.1.cs | 4 +- .../Vector512_1/GetAndWithElement.Int64.3.cs | 4 +- .../Vector512_1/GetAndWithElement.SByte.0.cs | 4 +- .../Vector512_1/GetAndWithElement.SByte.15.cs | 4 +- .../Vector512_1/GetAndWithElement.SByte.31.cs | 4 +- .../Vector512_1/GetAndWithElement.SByte.7.cs | 4 +- .../Vector512_1/GetAndWithElement.Single.0.cs | 4 +- .../Vector512_1/GetAndWithElement.Single.1.cs | 4 +- .../Vector512_1/GetAndWithElement.Single.3.cs | 4 +- .../Vector512_1/GetAndWithElement.Single.7.cs | 4 +- .../Vector512_1/GetAndWithElement.UInt16.0.cs | 4 +- .../GetAndWithElement.UInt16.15.cs | 4 +- .../Vector512_1/GetAndWithElement.UInt16.3.cs | 4 +- .../Vector512_1/GetAndWithElement.UInt16.7.cs | 4 +- .../Vector512_1/GetAndWithElement.UInt32.0.cs | 4 +- .../Vector512_1/GetAndWithElement.UInt32.1.cs | 4 +- .../Vector512_1/GetAndWithElement.UInt32.3.cs | 4 +- .../Vector512_1/GetAndWithElement.UInt32.7.cs | 4 +- .../Vector512_1/GetAndWithElement.UInt64.0.cs | 4 +- .../Vector512_1/GetAndWithElement.UInt64.1.cs | 4 +- .../Vector512_1/GetAndWithElement.UInt64.3.cs | 4 +- .../GetAndWithLowerAndUpper.Byte.cs | 4 +- .../GetAndWithLowerAndUpper.Double.cs | 4 +- .../GetAndWithLowerAndUpper.Int16.cs | 4 +- .../GetAndWithLowerAndUpper.Int32.cs | 4 +- .../GetAndWithLowerAndUpper.Int64.cs | 4 +- .../GetAndWithLowerAndUpper.SByte.cs | 4 +- .../GetAndWithLowerAndUpper.Single.cs | 4 +- .../GetAndWithLowerAndUpper.UInt16.cs | 4 +- .../GetAndWithLowerAndUpper.UInt32.cs | 4 +- .../GetAndWithLowerAndUpper.UInt64.cs | 4 +- .../General/Vector512_1/ToScalar.Byte.cs | 4 +- .../General/Vector512_1/ToScalar.Double.cs | 4 +- .../General/Vector512_1/ToScalar.Int16.cs | 4 +- .../General/Vector512_1/ToScalar.Int32.cs | 4 +- .../General/Vector512_1/ToScalar.Int64.cs | 4 +- .../General/Vector512_1/ToScalar.SByte.cs | 4 +- .../General/Vector512_1/ToScalar.Single.cs | 4 +- .../General/Vector512_1/ToScalar.UInt16.cs | 4 +- .../General/Vector512_1/ToScalar.UInt32.cs | 4 +- .../General/Vector512_1/ToScalar.UInt64.cs | 4 +- .../General/Vector512_1/ToString.Byte.cs | 2 +- .../General/Vector512_1/ToString.Double.cs | 2 +- .../General/Vector512_1/ToString.Int16.cs | 2 +- .../General/Vector512_1/ToString.Int32.cs | 2 +- .../General/Vector512_1/ToString.Int64.cs | 2 +- .../General/Vector512_1/ToString.SByte.cs | 2 +- .../General/Vector512_1/ToString.Single.cs | 2 +- .../General/Vector512_1/ToString.UInt16.cs | 2 +- .../General/Vector512_1/ToString.UInt32.cs | 2 +- .../General/Vector512_1/ToString.UInt64.cs | 2 +- 78 files changed, 224 insertions(+), 224 deletions(-) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/GenerateTests.csx b/src/tests/JIT/HardwareIntrinsics/General/Shared/GenerateTests.csx index e131b642414459..dcb1e7dbb659ec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/GenerateTests.csx +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/GenerateTests.csx @@ -2121,16 +2121,16 @@ private static readonly (string templateFileName, Dictionary tem ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalarUnsafe", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "false /* value is uninitialized */" }), ("VectorCreateTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "CreateScalarUnsafe", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "resultElements[0] != expectedValue", ["ValidateRemainingResults"] = "false /* value is uninitialized */" }), - ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), - ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), - ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), - ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), - ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), - ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), - ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]" }), + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]" }), + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorCreateElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), ("VectorCreateVectorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["OpVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()" }), ("VectorCreateVectorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "Create", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["OpVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()" }), @@ -2485,76 +2485,76 @@ private static readonly (string templateFileName, Dictionary tem ("VectorAsNumericsVectorTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AsVector", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(uint)TestLibrary.Generator.GetUInt32()" }), ("VectorAsNumericsVectorTest.template", new Dictionary { ["Isa"] = "Vector512_1", ["Method"] = "AsVector", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp"] = "(ulong)TestLibrary.Generator.GetUInt64()" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "15", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "31", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "15", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "15", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "31", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "15", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), - ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), - - ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), - ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), - ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), - ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), - ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), - ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), - ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), - - ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), - ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), - ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), - ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), - ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), - ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), - ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), - - ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), - ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), - ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), - ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), - ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), - ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), - ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), - ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "15", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "31", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "15", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "15", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "31", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "15", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "7", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "0", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithElementTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "3", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]" }), + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]" }), + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorGetAndWithLowerAndUpperTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "GetAndWithLowerAndUpper", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["TgtVectorType"] = "Vector256", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]" }), + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]" }), + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorToScalarTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "ToScalar", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]" }), + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]" }), + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }), + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }), + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), + ("VectorToStringTest.template", new Dictionary {["Isa"] = "Vector512", ["Method"] = "ToString", ["VectorType"] = "Vector512", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()", ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]" }), ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Addition", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != (byte)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (byte)(left[i] + right[i])" }), ("VectorBinaryOperatorTest.template", new Dictionary { ["Isa"] = "Vector512", ["Method"] = "op_Addition", ["Opcode"] = "+", ["RetVectorType"] = "Vector512", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector512", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector512", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != (double)(left[0] + right[0])", ["ValidateRemainingResults"] = "result[i] != (double)(left[i] + right[i])" }), diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Byte.cs index 91e5339a70b285..e1b48e2c0b55e2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Byte.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetByte(); } - Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); ValidateResult(result, values); } @@ -75,7 +75,7 @@ public void RunReflectionScenario() object result = typeof(Vector512) .GetMethod(nameof(Vector512.Create), operandTypes) - .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31] }); + .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63] }); ValidateResult((Vector512)(result), values); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Double.cs index f7c6773b76aaa6..3ea6fd7e847b5b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Double.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetDouble(); } - Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); ValidateResult(result, values); } @@ -75,7 +75,7 @@ public void RunReflectionScenario() object result = typeof(Vector512) .GetMethod(nameof(Vector512.Create), operandTypes) - .Invoke(null, new object[] { values[0], values[1], values[2], values[3] }); + .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7] }); ValidateResult((Vector512)(result), values); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int16.cs index dcb14180d25c0a..aa8d95c8a1092c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int16.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetInt16(); } - Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); ValidateResult(result, values); } @@ -75,7 +75,7 @@ public void RunReflectionScenario() object result = typeof(Vector512) .GetMethod(nameof(Vector512.Create), operandTypes) - .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15] }); + .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31] }); ValidateResult((Vector512)(result), values); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int32.cs index 52d249a724f254..5cb9d2dc545196 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int32.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetInt32(); } - Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); ValidateResult(result, values); } @@ -75,7 +75,7 @@ public void RunReflectionScenario() object result = typeof(Vector512) .GetMethod(nameof(Vector512.Create), operandTypes) - .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7] }); + .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15] }); ValidateResult((Vector512)(result), values); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int64.cs index 7e363332fd8d62..7e1ed5055d37ff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Int64.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetInt64(); } - Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); ValidateResult(result, values); } @@ -75,7 +75,7 @@ public void RunReflectionScenario() object result = typeof(Vector512) .GetMethod(nameof(Vector512.Create), operandTypes) - .Invoke(null, new object[] { values[0], values[1], values[2], values[3] }); + .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7] }); ValidateResult((Vector512)(result), values); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.SByte.cs index 4da78fd46a9777..dfc7329296c0bf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.SByte.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetSByte(); } - Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); ValidateResult(result, values); } @@ -75,7 +75,7 @@ public void RunReflectionScenario() object result = typeof(Vector512) .GetMethod(nameof(Vector512.Create), operandTypes) - .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31] }); + .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63] }); ValidateResult((Vector512)(result), values); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Single.cs index d6173913faa102..03371b38590b97 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.Single.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetSingle(); } - Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); ValidateResult(result, values); } @@ -75,7 +75,7 @@ public void RunReflectionScenario() object result = typeof(Vector512) .GetMethod(nameof(Vector512.Create), operandTypes) - .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7] }); + .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15] }); ValidateResult((Vector512)(result), values); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt16.cs index 2f2061f520a139..ad407c12c1f015 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt16.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetUInt16(); } - Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); ValidateResult(result, values); } @@ -75,7 +75,7 @@ public void RunReflectionScenario() object result = typeof(Vector512) .GetMethod(nameof(Vector512.Create), operandTypes) - .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15] }); + .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31] }); ValidateResult((Vector512)(result), values); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt32.cs index 598fc1e9d02244..0d4cf60df69324 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt32.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetUInt32(); } - Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); ValidateResult(result, values); } @@ -75,7 +75,7 @@ public void RunReflectionScenario() object result = typeof(Vector512) .GetMethod(nameof(Vector512.Create), operandTypes) - .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7] }); + .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15] }); ValidateResult((Vector512)(result), values); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt64.cs index 89b3a6058c44a8..25e98118353b47 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/CreateElement.UInt64.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetUInt64(); } - Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 result = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); ValidateResult(result, values); } @@ -75,7 +75,7 @@ public void RunReflectionScenario() object result = typeof(Vector512) .GetMethod(nameof(Vector512.Create), operandTypes) - .Invoke(null, new object[] { values[0], values[1], values[2], values[3] }); + .Invoke(null, new object[] { values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7] }); ValidateResult((Vector512)(result), values); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.0.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.0.cs index 38744365a94d96..2d17be5bc632c0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.0.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.0.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 0, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.15.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.15.cs index a3f8a4ccb81e61..39660c8eff0516 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.15.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.15.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 15, bool expectedOutOfRangeException = fa values[i] = TestLibrary.Generator.GetByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 15, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.31.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.31.cs index 2dab9d8c6982b9..a8b3bf014c3fa6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.31.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.31.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 31, bool expectedOutOfRangeException = fa values[i] = TestLibrary.Generator.GetByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 31, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.7.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.7.cs index c210c0fa7788bb..a2843c70c3ea8b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.7.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Byte.7.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 7, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 7, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Double.0.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Double.0.cs index 6829e3156d9c26..b5009309f0c4f0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Double.0.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Double.0.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetDouble(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 0, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetDouble(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Double.1.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Double.1.cs index 49d70c0c54e3c5..c09b74a0e2ec56 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Double.1.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Double.1.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 1, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetDouble(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 1, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetDouble(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Double.3.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Double.3.cs index 0b2a13edb5276b..bc94edbb5bccce 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Double.3.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Double.3.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 3, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetDouble(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 3, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetDouble(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.0.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.0.cs index 7499eef104df2c..57cf5502c790c4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.0.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.0.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 0, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.15.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.15.cs index 7cc708c59c1cc4..8c17763e918bee 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.15.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.15.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 15, bool expectedOutOfRangeException = fa values[i] = TestLibrary.Generator.GetInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 15, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.3.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.3.cs index 2a5e3527c6cc72..3a5b22fa5ec654 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.3.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.3.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 3, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 3, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.7.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.7.cs index 5dd7ce8272110e..c4da856d944c4b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.7.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int16.7.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 7, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 7, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.0.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.0.cs index 97ab2fcc3673b3..31737b94e3340e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.0.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.0.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 0, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.1.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.1.cs index be3b551fe6f95f..4c8a005b94a508 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.1.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.1.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 1, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 1, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.3.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.3.cs index 4c30adbb14b8ed..69699b0bf24767 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.3.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.3.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 3, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 3, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.7.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.7.cs index 8c41c2665e1954..791d830c262b76 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.7.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int32.7.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 7, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 7, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int64.0.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int64.0.cs index 31dee79413b4d1..52ca11e111db61 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int64.0.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int64.0.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 0, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int64.1.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int64.1.cs index bcba5b3484f48e..1dafc6e403912b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int64.1.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int64.1.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 1, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 1, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int64.3.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int64.3.cs index 23aed7fdf6162f..39f7a56ea4b406 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int64.3.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Int64.3.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 3, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 3, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.0.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.0.cs index e6d234e549ebba..d65edee996f824 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.0.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.0.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetSByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 0, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetSByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.15.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.15.cs index d6017ee0046244..fc5d4d5bcfcb60 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.15.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.15.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 15, bool expectedOutOfRangeException = fa values[i] = TestLibrary.Generator.GetSByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 15, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetSByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.31.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.31.cs index df56bd572df65d..5751dfaa6e91dc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.31.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.31.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 31, bool expectedOutOfRangeException = fa values[i] = TestLibrary.Generator.GetSByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 31, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetSByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.7.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.7.cs index 61edd834b747ee..d4368cca222443 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.7.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.SByte.7.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 7, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetSByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 7, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetSByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.0.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.0.cs index 6585a0ce7e3017..5c69bd259236cb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.0.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.0.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetSingle(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 0, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetSingle(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.1.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.1.cs index bc1fc4b6e379d8..9ce7dd619f199e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.1.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.1.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 1, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetSingle(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 1, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetSingle(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.3.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.3.cs index 3b992bc6ca5c23..0eca68fbb9562d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.3.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.3.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 3, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetSingle(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 3, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetSingle(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.7.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.7.cs index 4dd6a69c42b4c1..b1a3d75d37116e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.7.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.Single.7.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 7, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetSingle(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 7, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetSingle(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.0.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.0.cs index 7c451493d6583f..e9d70c25cffc05 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.0.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.0.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetUInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 0, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetUInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.15.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.15.cs index fca4635f894ea1..b9055a5c86492c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.15.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.15.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 15, bool expectedOutOfRangeException = fa values[i] = TestLibrary.Generator.GetUInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 15, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetUInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.3.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.3.cs index c34c9ae36e0a59..1e66603099df0c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.3.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.3.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 3, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetUInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 3, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetUInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.7.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.7.cs index c868057f705d50..117c313b6b45e9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.7.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt16.7.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 7, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetUInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 7, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetUInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.0.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.0.cs index c8443135d71439..8b2eef99b01c9b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.0.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.0.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetUInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 0, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetUInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.1.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.1.cs index 0ede1127c5cdfd..ca9db5d95ad01c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.1.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.1.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 1, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetUInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 1, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetUInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.3.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.3.cs index 25f9156a01abce..f49e1796c0d7c4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.3.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.3.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 3, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetUInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 3, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetUInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.7.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.7.cs index a7bfdde548fd9f..b0ef02d247bab2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.7.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt32.7.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 7, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetUInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 7, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetUInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt64.0.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt64.0.cs index d8f5e63123d7a3..e83925760f3c7d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt64.0.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt64.0.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 0, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetUInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 0, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetUInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt64.1.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt64.1.cs index cc67e3386d3dab..24da4ae8cb0b4b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt64.1.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt64.1.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 1, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetUInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 1, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetUInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt64.3.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt64.3.cs index e828d00501f75b..fb571b04fa910a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt64.3.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithElement.UInt64.3.cs @@ -59,7 +59,7 @@ public void RunBasicScenario(int imm = 3, bool expectedOutOfRangeException = fal values[i] = TestLibrary.Generator.GetUInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); bool succeeded = !expectedOutOfRangeException; @@ -115,7 +115,7 @@ public void RunReflectionScenario(int imm = 3, bool expectedOutOfRangeException values[i] = TestLibrary.Generator.GetUInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); bool succeeded = !expectedOutOfRangeException; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Byte.cs index 6c96ca96ced672..09655e3fa5d9bd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Byte.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); Vector256 lowerResult = value.GetLower(); Vector256 upperResult = value.GetUpper(); @@ -77,7 +77,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); object lowerResult = typeof(Vector512) .GetMethod(nameof(Vector512.GetLower)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Double.cs index f222ee0ec5c826..40663a4d9d8cc8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Double.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetDouble(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); Vector256 lowerResult = value.GetLower(); Vector256 upperResult = value.GetUpper(); @@ -77,7 +77,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetDouble(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); object lowerResult = typeof(Vector512) .GetMethod(nameof(Vector512.GetLower)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Int16.cs index 6f7939b3c9a782..b0a3463c42c47e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Int16.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); Vector256 lowerResult = value.GetLower(); Vector256 upperResult = value.GetUpper(); @@ -77,7 +77,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); object lowerResult = typeof(Vector512) .GetMethod(nameof(Vector512.GetLower)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Int32.cs index 0f561d4d8220b4..560789cc975702 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Int32.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); Vector256 lowerResult = value.GetLower(); Vector256 upperResult = value.GetUpper(); @@ -77,7 +77,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); object lowerResult = typeof(Vector512) .GetMethod(nameof(Vector512.GetLower)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Int64.cs index 17478a155119c3..aba89bc0254c88 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Int64.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); Vector256 lowerResult = value.GetLower(); Vector256 upperResult = value.GetUpper(); @@ -77,7 +77,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); object lowerResult = typeof(Vector512) .GetMethod(nameof(Vector512.GetLower)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.SByte.cs index 3ffe703ed5dbe9..44e6849aa86f1a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.SByte.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetSByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); Vector256 lowerResult = value.GetLower(); Vector256 upperResult = value.GetUpper(); @@ -77,7 +77,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetSByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); object lowerResult = typeof(Vector512) .GetMethod(nameof(Vector512.GetLower)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Single.cs index df863c4d51c44e..8ed3a57677d2d5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.Single.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetSingle(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); Vector256 lowerResult = value.GetLower(); Vector256 upperResult = value.GetUpper(); @@ -77,7 +77,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetSingle(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); object lowerResult = typeof(Vector512) .GetMethod(nameof(Vector512.GetLower)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.UInt16.cs index ae9be552b0c0ea..dc2cde67aefbc7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.UInt16.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetUInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); Vector256 lowerResult = value.GetLower(); Vector256 upperResult = value.GetUpper(); @@ -77,7 +77,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetUInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); object lowerResult = typeof(Vector512) .GetMethod(nameof(Vector512.GetLower)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.UInt32.cs index b5401f0e30196e..286cf7ba656478 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.UInt32.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetUInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); Vector256 lowerResult = value.GetLower(); Vector256 upperResult = value.GetUpper(); @@ -77,7 +77,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetUInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); object lowerResult = typeof(Vector512) .GetMethod(nameof(Vector512.GetLower)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.UInt64.cs index cfeae2fe1546ec..9c5a8d7a4c4922 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/GetAndWithLowerAndUpper.UInt64.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetUInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); Vector256 lowerResult = value.GetLower(); Vector256 upperResult = value.GetUpper(); @@ -77,7 +77,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetUInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); object lowerResult = typeof(Vector512) .GetMethod(nameof(Vector512.GetLower)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Byte.cs index 6b3de52778cf04..ffd2491cf4ee71 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Byte.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); Byte result = value.ToScalar(); ValidateResult(result, values); @@ -72,7 +72,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); object result = typeof(Vector512) .GetMethod(nameof(Vector512.ToScalar)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Double.cs index 2e3bdedbc5d337..03e8ab76443d94 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Double.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetDouble(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); Double result = value.ToScalar(); ValidateResult(result, values); @@ -72,7 +72,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetDouble(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); object result = typeof(Vector512) .GetMethod(nameof(Vector512.ToScalar)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int16.cs index 735a35fcf2ce6f..bbf50ce949c40c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int16.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); Int16 result = value.ToScalar(); ValidateResult(result, values); @@ -72,7 +72,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); object result = typeof(Vector512) .GetMethod(nameof(Vector512.ToScalar)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int32.cs index 4eefa445478ec0..e9a390e722698e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int32.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); Int32 result = value.ToScalar(); ValidateResult(result, values); @@ -72,7 +72,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); object result = typeof(Vector512) .GetMethod(nameof(Vector512.ToScalar)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int64.cs index 08466f04ad4532..6edb885b7975fb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Int64.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); Int64 result = value.ToScalar(); ValidateResult(result, values); @@ -72,7 +72,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); object result = typeof(Vector512) .GetMethod(nameof(Vector512.ToScalar)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.SByte.cs index 3ab158d08ce95d..22618b471c6229 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.SByte.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetSByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); SByte result = value.ToScalar(); ValidateResult(result, values); @@ -72,7 +72,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetSByte(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); object result = typeof(Vector512) .GetMethod(nameof(Vector512.ToScalar)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Single.cs index 195b33885ca9c1..02379e8e12687b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.Single.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetSingle(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); Single result = value.ToScalar(); ValidateResult(result, values); @@ -72,7 +72,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetSingle(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); object result = typeof(Vector512) .GetMethod(nameof(Vector512.ToScalar)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt16.cs index 8130b2031376f3..7ad6e0f5260f8c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt16.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetUInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); UInt16 result = value.ToScalar(); ValidateResult(result, values); @@ -72,7 +72,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetUInt16(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); object result = typeof(Vector512) .GetMethod(nameof(Vector512.ToScalar)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt32.cs index 4d2b10d4dad57b..bd1bb54cf4a128 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt32.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetUInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); UInt32 result = value.ToScalar(); ValidateResult(result, values); @@ -72,7 +72,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetUInt32(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); object result = typeof(Vector512) .GetMethod(nameof(Vector512.ToScalar)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt64.cs index d218bcae49acbd..f600c3456a3de2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToScalar.UInt64.cs @@ -55,7 +55,7 @@ public void RunBasicScenario() values[i] = TestLibrary.Generator.GetUInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); UInt64 result = value.ToScalar(); ValidateResult(result, values); @@ -72,7 +72,7 @@ public void RunReflectionScenario() values[i] = TestLibrary.Generator.GetUInt64(); } - Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 value = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); object result = typeof(Vector512) .GetMethod(nameof(Vector512.ToScalar)) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Byte.cs index 06406e7f1ecc82..41de559d31ec8b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Byte.cs @@ -30,7 +30,7 @@ public unsafe static void ToStringByte() values[i] = TestLibrary.Generator.GetByte(); } - Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); string actual = vector.ToString(); string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Double.cs index e8d080eaaed3af..8481e87c269a49 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Double.cs @@ -30,7 +30,7 @@ public unsafe static void ToStringDouble() values[i] = TestLibrary.Generator.GetDouble(); } - Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); string actual = vector.ToString(); string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int16.cs index 5adb5c70093f44..282e3af5df8bb4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int16.cs @@ -30,7 +30,7 @@ public unsafe static void ToStringInt16() values[i] = TestLibrary.Generator.GetInt16(); } - Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); string actual = vector.ToString(); string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int32.cs index 248ab1b704dd43..d4d70249464fa4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int32.cs @@ -30,7 +30,7 @@ public unsafe static void ToStringInt32() values[i] = TestLibrary.Generator.GetInt32(); } - Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); string actual = vector.ToString(); string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int64.cs index 72628f1971d081..0141d2466c2357 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Int64.cs @@ -30,7 +30,7 @@ public unsafe static void ToStringInt64() values[i] = TestLibrary.Generator.GetInt64(); } - Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); string actual = vector.ToString(); string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.SByte.cs index e439bc6cd0cd9f..23e7792a63c8de 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.SByte.cs @@ -30,7 +30,7 @@ public unsafe static void ToStringSByte() values[i] = TestLibrary.Generator.GetSByte(); } - Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31], values[32], values[33], values[34], values[35], values[36], values[37], values[38], values[39], values[40], values[41], values[42], values[43], values[44], values[45], values[46], values[47], values[48], values[49], values[50], values[51], values[52], values[53], values[54], values[55], values[56], values[57], values[58], values[59], values[60], values[61], values[62], values[63]); string actual = vector.ToString(); string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Single.cs index 3ed44005ce289f..c81227a7817cdf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.Single.cs @@ -30,7 +30,7 @@ public unsafe static void ToStringSingle() values[i] = TestLibrary.Generator.GetSingle(); } - Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); string actual = vector.ToString(); string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt16.cs index ab54dc24e590aa..3f92533964729f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt16.cs @@ -30,7 +30,7 @@ public unsafe static void ToStringUInt16() values[i] = TestLibrary.Generator.GetUInt16(); } - Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]); string actual = vector.ToString(); string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt32.cs index 84a60f149c983f..0e489e3686a740 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt32.cs @@ -30,7 +30,7 @@ public unsafe static void ToStringUInt32() values[i] = TestLibrary.Generator.GetUInt32(); } - Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]); string actual = vector.ToString(); string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt64.cs index bd1e6c8250101f..d598e4b48bbf68 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/ToString.UInt64.cs @@ -30,7 +30,7 @@ public unsafe static void ToStringUInt64() values[i] = TestLibrary.Generator.GetUInt64(); } - Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3]); + Vector512 vector = Vector512.Create(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); string actual = vector.ToString(); string expected = '<' + string.Join(", ", values.Select(x => x.ToString("G", System.Globalization.CultureInfo.InvariantCulture))) + '>'; From 437134a03e5e26f39ebe0d8ccb18ca71c99c7a14 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Sat, 12 Nov 2022 09:14:25 -0800 Subject: [PATCH 10/26] Ensure the HWIntrinsic test templates support 64-byte alignment --- .../General/Shared/VectorBinaryOpTest.template | 2 +- .../General/Shared/VectorBinaryOperatorTest.template | 2 +- .../General/Shared/VectorBooleanAllBinaryOpTest.template | 2 +- .../General/Shared/VectorBooleanAllBinaryOperatorTest.template | 2 +- .../General/Shared/VectorBooleanAnyBinaryOpTest.template | 2 +- .../General/Shared/VectorBooleanAnyBinaryOperatorTest.template | 2 +- .../General/Shared/VectorConvertToTest.template | 2 +- .../HardwareIntrinsics/General/Shared/VectorDotTest.template | 2 +- .../HardwareIntrinsics/General/Shared/VectorNarrowTest.template | 2 +- .../General/Shared/VectorTernaryOpTest.template | 2 +- .../General/Shared/VectorUnaryOpTest.template | 2 +- .../General/Shared/VectorUnaryOperatorTest.template | 2 +- .../HardwareIntrinsics/General/Shared/VectorWidenTest.template | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Abs.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Abs.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Abs.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Abs.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Abs.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Add.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Add.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Add.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Add.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Add.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseAnd.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseAnd.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseAnd.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseAnd.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseAnd.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseAnd.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseOr.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseOr.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseOr.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseOr.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseOr.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Ceiling.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Ceiling.Single.cs | 2 +- .../General/Vector128/ConditionalSelect.Byte.cs | 2 +- .../General/Vector128/ConditionalSelect.Double.cs | 2 +- .../General/Vector128/ConditionalSelect.Int16.cs | 2 +- .../General/Vector128/ConditionalSelect.Int32.cs | 2 +- .../General/Vector128/ConditionalSelect.Int64.cs | 2 +- .../General/Vector128/ConditionalSelect.SByte.cs | 2 +- .../General/Vector128/ConditionalSelect.Single.cs | 2 +- .../General/Vector128/ConditionalSelect.UInt16.cs | 2 +- .../General/Vector128/ConditionalSelect.UInt32.cs | 2 +- .../General/Vector128/ConditionalSelect.UInt64.cs | 2 +- .../General/Vector128/ConvertToDouble.Int64.cs | 2 +- .../General/Vector128/ConvertToDouble.UInt64.cs | 2 +- .../General/Vector128/ConvertToInt32.Single.cs | 2 +- .../General/Vector128/ConvertToInt64.Double.cs | 2 +- .../General/Vector128/ConvertToSingle.Int32.cs | 2 +- .../General/Vector128/ConvertToSingle.UInt32.cs | 2 +- .../General/Vector128/ConvertToUInt32.Single.cs | 2 +- .../General/Vector128/ConvertToUInt64.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAll.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAll.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAll.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAll.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAll.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAll.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAny.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAny.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAny.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAny.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAny.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAny.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Floor.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Floor.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThanAll.Byte.cs | 2 +- .../General/Vector128/GreaterThanAll.Double.cs | 2 +- .../General/Vector128/GreaterThanAll.Int16.cs | 2 +- .../General/Vector128/GreaterThanAll.Int32.cs | 2 +- .../General/Vector128/GreaterThanAll.Int64.cs | 2 +- .../General/Vector128/GreaterThanAll.SByte.cs | 2 +- .../General/Vector128/GreaterThanAll.Single.cs | 2 +- .../General/Vector128/GreaterThanAll.UInt16.cs | 2 +- .../General/Vector128/GreaterThanAll.UInt32.cs | 2 +- .../General/Vector128/GreaterThanAll.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThanAny.Byte.cs | 2 +- .../General/Vector128/GreaterThanAny.Double.cs | 2 +- .../General/Vector128/GreaterThanAny.Int16.cs | 2 +- .../General/Vector128/GreaterThanAny.Int32.cs | 2 +- .../General/Vector128/GreaterThanAny.Int64.cs | 2 +- .../General/Vector128/GreaterThanAny.SByte.cs | 2 +- .../General/Vector128/GreaterThanAny.Single.cs | 2 +- .../General/Vector128/GreaterThanAny.UInt16.cs | 2 +- .../General/Vector128/GreaterThanAny.UInt32.cs | 2 +- .../General/Vector128/GreaterThanAny.UInt64.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.Byte.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.Double.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.Int16.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.Int32.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.Int64.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.SByte.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.Single.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.UInt16.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.UInt32.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.UInt64.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.Byte.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.Double.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.Int16.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.Int32.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.Int64.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.SByte.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.Single.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.UInt16.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.UInt32.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.UInt64.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.Byte.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.Double.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.Int16.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.Int32.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.Int64.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.SByte.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.Single.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.UInt16.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.UInt32.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.UInt64.cs | 2 +- .../General/Vector128/LessThanOrEqual.Byte.cs | 2 +- .../General/Vector128/LessThanOrEqual.Double.cs | 2 +- .../General/Vector128/LessThanOrEqual.Int16.cs | 2 +- .../General/Vector128/LessThanOrEqual.Int32.cs | 2 +- .../General/Vector128/LessThanOrEqual.Int64.cs | 2 +- .../General/Vector128/LessThanOrEqual.SByte.cs | 2 +- .../General/Vector128/LessThanOrEqual.Single.cs | 2 +- .../General/Vector128/LessThanOrEqual.UInt16.cs | 2 +- .../General/Vector128/LessThanOrEqual.UInt32.cs | 2 +- .../General/Vector128/LessThanOrEqual.UInt64.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.Byte.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.Double.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.Int16.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.Int32.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.Int64.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.SByte.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.Single.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.UInt16.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.UInt32.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.UInt64.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.Byte.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.Double.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.Int16.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.Int32.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.Int64.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.SByte.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.Single.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.UInt16.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.UInt32.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Max.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Max.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Max.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Max.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Max.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Min.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Min.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Min.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Min.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Min.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Narrow.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Narrow.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Narrow.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Narrow.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128/OnesComplement.Byte.cs | 2 +- .../General/Vector128/OnesComplement.Double.cs | 2 +- .../General/Vector128/OnesComplement.Int16.cs | 2 +- .../General/Vector128/OnesComplement.Int32.cs | 2 +- .../General/Vector128/OnesComplement.Int64.cs | 2 +- .../General/Vector128/OnesComplement.SByte.cs | 2 +- .../General/Vector128/OnesComplement.Single.cs | 2 +- .../General/Vector128/OnesComplement.UInt16.cs | 2 +- .../General/Vector128/OnesComplement.UInt32.cs | 2 +- .../General/Vector128/OnesComplement.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Sqrt.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Sqrt.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Sqrt.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Widen.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Widen.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Widen.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Widen.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Widen.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Widen.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Widen.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Xor.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Xor.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Xor.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Xor.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Xor.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Addition.Byte.cs | 2 +- .../General/Vector128_1/op_Addition.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Addition.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Addition.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Addition.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Addition.SByte.cs | 2 +- .../General/Vector128_1/op_Addition.Single.cs | 2 +- .../General/Vector128_1/op_Addition.UInt16.cs | 2 +- .../General/Vector128_1/op_Addition.UInt32.cs | 2 +- .../General/Vector128_1/op_Addition.UInt64.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.Byte.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.Double.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.Int16.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.Int32.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.Int64.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.SByte.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.Single.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.UInt16.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.UInt32.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Byte.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.Double.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.Int16.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.Int32.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.Int64.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.SByte.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.Single.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.UInt16.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.UInt32.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Division.Byte.cs | 2 +- .../General/Vector128_1/op_Division.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Division.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Division.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Division.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Division.SByte.cs | 2 +- .../General/Vector128_1/op_Division.Single.cs | 2 +- .../General/Vector128_1/op_Division.UInt16.cs | 2 +- .../General/Vector128_1/op_Division.UInt32.cs | 2 +- .../General/Vector128_1/op_Division.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Equality.Byte.cs | 2 +- .../General/Vector128_1/op_Equality.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Equality.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Equality.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Equality.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Equality.SByte.cs | 2 +- .../General/Vector128_1/op_Equality.Single.cs | 2 +- .../General/Vector128_1/op_Equality.UInt16.cs | 2 +- .../General/Vector128_1/op_Equality.UInt32.cs | 2 +- .../General/Vector128_1/op_Equality.UInt64.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.Byte.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.Double.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.Int16.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.Int32.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.Int64.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.SByte.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.Single.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.UInt16.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.UInt32.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.UInt64.cs | 2 +- .../General/Vector128_1/op_Inequality.Byte.cs | 2 +- .../General/Vector128_1/op_Inequality.Double.cs | 2 +- .../General/Vector128_1/op_Inequality.Int16.cs | 2 +- .../General/Vector128_1/op_Inequality.Int32.cs | 2 +- .../General/Vector128_1/op_Inequality.Int64.cs | 2 +- .../General/Vector128_1/op_Inequality.SByte.cs | 2 +- .../General/Vector128_1/op_Inequality.Single.cs | 2 +- .../General/Vector128_1/op_Inequality.UInt16.cs | 2 +- .../General/Vector128_1/op_Inequality.UInt32.cs | 2 +- .../General/Vector128_1/op_Inequality.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Multiply.Byte.cs | 2 +- .../General/Vector128_1/op_Multiply.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Multiply.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Multiply.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Multiply.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Multiply.SByte.cs | 2 +- .../General/Vector128_1/op_Multiply.Single.cs | 2 +- .../General/Vector128_1/op_Multiply.UInt16.cs | 2 +- .../General/Vector128_1/op_Multiply.UInt32.cs | 2 +- .../General/Vector128_1/op_Multiply.UInt64.cs | 2 +- .../General/Vector128_1/op_OnesComplement.Byte.cs | 2 +- .../General/Vector128_1/op_OnesComplement.Double.cs | 2 +- .../General/Vector128_1/op_OnesComplement.Int16.cs | 2 +- .../General/Vector128_1/op_OnesComplement.Int32.cs | 2 +- .../General/Vector128_1/op_OnesComplement.Int64.cs | 2 +- .../General/Vector128_1/op_OnesComplement.SByte.cs | 2 +- .../General/Vector128_1/op_OnesComplement.Single.cs | 2 +- .../General/Vector128_1/op_OnesComplement.UInt16.cs | 2 +- .../General/Vector128_1/op_OnesComplement.UInt32.cs | 2 +- .../General/Vector128_1/op_OnesComplement.UInt64.cs | 2 +- .../General/Vector128_1/op_Subtraction.Byte.cs | 2 +- .../General/Vector128_1/op_Subtraction.Double.cs | 2 +- .../General/Vector128_1/op_Subtraction.Int16.cs | 2 +- .../General/Vector128_1/op_Subtraction.Int32.cs | 2 +- .../General/Vector128_1/op_Subtraction.Int64.cs | 2 +- .../General/Vector128_1/op_Subtraction.SByte.cs | 2 +- .../General/Vector128_1/op_Subtraction.Single.cs | 2 +- .../General/Vector128_1/op_Subtraction.UInt16.cs | 2 +- .../General/Vector128_1/op_Subtraction.UInt32.cs | 2 +- .../General/Vector128_1/op_Subtraction.UInt64.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.Byte.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.Double.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.Int16.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.Int32.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.Int64.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.SByte.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.Single.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.UInt16.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.UInt32.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Byte.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.Double.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.Int16.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.Int32.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.Int64.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.SByte.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.Single.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.UInt16.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.UInt32.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Abs.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Abs.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Abs.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Abs.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Abs.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Add.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Add.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Add.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Add.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Add.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseAnd.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseAnd.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseAnd.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseAnd.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseAnd.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseAnd.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseOr.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseOr.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseOr.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseOr.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseOr.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Ceiling.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Ceiling.Single.cs | 2 +- .../General/Vector256/ConditionalSelect.Byte.cs | 2 +- .../General/Vector256/ConditionalSelect.Double.cs | 2 +- .../General/Vector256/ConditionalSelect.Int16.cs | 2 +- .../General/Vector256/ConditionalSelect.Int32.cs | 2 +- .../General/Vector256/ConditionalSelect.Int64.cs | 2 +- .../General/Vector256/ConditionalSelect.SByte.cs | 2 +- .../General/Vector256/ConditionalSelect.Single.cs | 2 +- .../General/Vector256/ConditionalSelect.UInt16.cs | 2 +- .../General/Vector256/ConditionalSelect.UInt32.cs | 2 +- .../General/Vector256/ConditionalSelect.UInt64.cs | 2 +- .../General/Vector256/ConvertToDouble.Int64.cs | 2 +- .../General/Vector256/ConvertToDouble.UInt64.cs | 2 +- .../General/Vector256/ConvertToInt32.Single.cs | 2 +- .../General/Vector256/ConvertToInt64.Double.cs | 2 +- .../General/Vector256/ConvertToSingle.Int32.cs | 2 +- .../General/Vector256/ConvertToSingle.UInt32.cs | 2 +- .../General/Vector256/ConvertToUInt32.Single.cs | 2 +- .../General/Vector256/ConvertToUInt64.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAll.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAll.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAll.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAll.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAll.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAll.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAny.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAny.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAny.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAny.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAny.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAny.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Floor.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Floor.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThanAll.Byte.cs | 2 +- .../General/Vector256/GreaterThanAll.Double.cs | 2 +- .../General/Vector256/GreaterThanAll.Int16.cs | 2 +- .../General/Vector256/GreaterThanAll.Int32.cs | 2 +- .../General/Vector256/GreaterThanAll.Int64.cs | 2 +- .../General/Vector256/GreaterThanAll.SByte.cs | 2 +- .../General/Vector256/GreaterThanAll.Single.cs | 2 +- .../General/Vector256/GreaterThanAll.UInt16.cs | 2 +- .../General/Vector256/GreaterThanAll.UInt32.cs | 2 +- .../General/Vector256/GreaterThanAll.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThanAny.Byte.cs | 2 +- .../General/Vector256/GreaterThanAny.Double.cs | 2 +- .../General/Vector256/GreaterThanAny.Int16.cs | 2 +- .../General/Vector256/GreaterThanAny.Int32.cs | 2 +- .../General/Vector256/GreaterThanAny.Int64.cs | 2 +- .../General/Vector256/GreaterThanAny.SByte.cs | 2 +- .../General/Vector256/GreaterThanAny.Single.cs | 2 +- .../General/Vector256/GreaterThanAny.UInt16.cs | 2 +- .../General/Vector256/GreaterThanAny.UInt32.cs | 2 +- .../General/Vector256/GreaterThanAny.UInt64.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.Byte.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.Double.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.Int16.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.Int32.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.Int64.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.SByte.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.Single.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.UInt16.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.UInt32.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.UInt64.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.Byte.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.Double.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.Int16.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.Int32.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.Int64.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.SByte.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.Single.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.UInt16.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.UInt32.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.UInt64.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.Byte.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.Double.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.Int16.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.Int32.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.Int64.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.SByte.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.Single.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.UInt16.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.UInt32.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.UInt64.cs | 2 +- .../General/Vector256/LessThanOrEqual.Byte.cs | 2 +- .../General/Vector256/LessThanOrEqual.Double.cs | 2 +- .../General/Vector256/LessThanOrEqual.Int16.cs | 2 +- .../General/Vector256/LessThanOrEqual.Int32.cs | 2 +- .../General/Vector256/LessThanOrEqual.Int64.cs | 2 +- .../General/Vector256/LessThanOrEqual.SByte.cs | 2 +- .../General/Vector256/LessThanOrEqual.Single.cs | 2 +- .../General/Vector256/LessThanOrEqual.UInt16.cs | 2 +- .../General/Vector256/LessThanOrEqual.UInt32.cs | 2 +- .../General/Vector256/LessThanOrEqual.UInt64.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.Byte.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.Double.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.Int16.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.Int32.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.Int64.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.SByte.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.Single.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.UInt16.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.UInt32.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.UInt64.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.Byte.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.Double.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.Int16.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.Int32.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.Int64.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.SByte.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.Single.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.UInt16.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.UInt32.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Max.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Max.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Max.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Max.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Max.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Min.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Min.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Min.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Min.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Min.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Narrow.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Narrow.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Narrow.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Narrow.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256/OnesComplement.Byte.cs | 2 +- .../General/Vector256/OnesComplement.Double.cs | 2 +- .../General/Vector256/OnesComplement.Int16.cs | 2 +- .../General/Vector256/OnesComplement.Int32.cs | 2 +- .../General/Vector256/OnesComplement.Int64.cs | 2 +- .../General/Vector256/OnesComplement.SByte.cs | 2 +- .../General/Vector256/OnesComplement.Single.cs | 2 +- .../General/Vector256/OnesComplement.UInt16.cs | 2 +- .../General/Vector256/OnesComplement.UInt32.cs | 2 +- .../General/Vector256/OnesComplement.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Sqrt.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Sqrt.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Sqrt.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Widen.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Widen.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Widen.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Widen.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Widen.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Widen.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Widen.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Xor.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Xor.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Xor.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Xor.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Xor.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Addition.Byte.cs | 2 +- .../General/Vector256_1/op_Addition.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Addition.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Addition.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Addition.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Addition.SByte.cs | 2 +- .../General/Vector256_1/op_Addition.Single.cs | 2 +- .../General/Vector256_1/op_Addition.UInt16.cs | 2 +- .../General/Vector256_1/op_Addition.UInt32.cs | 2 +- .../General/Vector256_1/op_Addition.UInt64.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.Byte.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.Double.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.Int16.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.Int32.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.Int64.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.SByte.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.Single.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.UInt16.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.UInt32.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Byte.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.Double.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.Int16.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.Int32.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.Int64.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.SByte.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.Single.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.UInt16.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.UInt32.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Division.Byte.cs | 2 +- .../General/Vector256_1/op_Division.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Division.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Division.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Division.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Division.SByte.cs | 2 +- .../General/Vector256_1/op_Division.Single.cs | 2 +- .../General/Vector256_1/op_Division.UInt16.cs | 2 +- .../General/Vector256_1/op_Division.UInt32.cs | 2 +- .../General/Vector256_1/op_Division.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Equality.Byte.cs | 2 +- .../General/Vector256_1/op_Equality.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Equality.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Equality.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Equality.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Equality.SByte.cs | 2 +- .../General/Vector256_1/op_Equality.Single.cs | 2 +- .../General/Vector256_1/op_Equality.UInt16.cs | 2 +- .../General/Vector256_1/op_Equality.UInt32.cs | 2 +- .../General/Vector256_1/op_Equality.UInt64.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.Byte.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.Double.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.Int16.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.Int32.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.Int64.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.SByte.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.Single.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.UInt16.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.UInt32.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.UInt64.cs | 2 +- .../General/Vector256_1/op_Inequality.Byte.cs | 2 +- .../General/Vector256_1/op_Inequality.Double.cs | 2 +- .../General/Vector256_1/op_Inequality.Int16.cs | 2 +- .../General/Vector256_1/op_Inequality.Int32.cs | 2 +- .../General/Vector256_1/op_Inequality.Int64.cs | 2 +- .../General/Vector256_1/op_Inequality.SByte.cs | 2 +- .../General/Vector256_1/op_Inequality.Single.cs | 2 +- .../General/Vector256_1/op_Inequality.UInt16.cs | 2 +- .../General/Vector256_1/op_Inequality.UInt32.cs | 2 +- .../General/Vector256_1/op_Inequality.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Multiply.Byte.cs | 2 +- .../General/Vector256_1/op_Multiply.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Multiply.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Multiply.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Multiply.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Multiply.SByte.cs | 2 +- .../General/Vector256_1/op_Multiply.Single.cs | 2 +- .../General/Vector256_1/op_Multiply.UInt16.cs | 2 +- .../General/Vector256_1/op_Multiply.UInt32.cs | 2 +- .../General/Vector256_1/op_Multiply.UInt64.cs | 2 +- .../General/Vector256_1/op_OnesComplement.Byte.cs | 2 +- .../General/Vector256_1/op_OnesComplement.Double.cs | 2 +- .../General/Vector256_1/op_OnesComplement.Int16.cs | 2 +- .../General/Vector256_1/op_OnesComplement.Int32.cs | 2 +- .../General/Vector256_1/op_OnesComplement.Int64.cs | 2 +- .../General/Vector256_1/op_OnesComplement.SByte.cs | 2 +- .../General/Vector256_1/op_OnesComplement.Single.cs | 2 +- .../General/Vector256_1/op_OnesComplement.UInt16.cs | 2 +- .../General/Vector256_1/op_OnesComplement.UInt32.cs | 2 +- .../General/Vector256_1/op_OnesComplement.UInt64.cs | 2 +- .../General/Vector256_1/op_Subtraction.Byte.cs | 2 +- .../General/Vector256_1/op_Subtraction.Double.cs | 2 +- .../General/Vector256_1/op_Subtraction.Int16.cs | 2 +- .../General/Vector256_1/op_Subtraction.Int32.cs | 2 +- .../General/Vector256_1/op_Subtraction.Int64.cs | 2 +- .../General/Vector256_1/op_Subtraction.SByte.cs | 2 +- .../General/Vector256_1/op_Subtraction.Single.cs | 2 +- .../General/Vector256_1/op_Subtraction.UInt16.cs | 2 +- .../General/Vector256_1/op_Subtraction.UInt32.cs | 2 +- .../General/Vector256_1/op_Subtraction.UInt64.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.Byte.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.Double.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.Int16.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.Int32.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.Int64.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.SByte.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.Single.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.UInt16.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.UInt32.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Byte.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.Double.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.Int16.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.Int32.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.Int64.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.SByte.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.Single.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.UInt16.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.UInt32.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Abs.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Abs.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Abs.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Abs.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Abs.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Add.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Add.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Add.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Add.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Add.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseAnd.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseAnd.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseAnd.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseAnd.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseAnd.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseAnd.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseOr.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseOr.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseOr.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseOr.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseOr.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Ceiling.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Ceiling.Single.cs | 2 +- .../General/Vector512/ConditionalSelect.Byte.cs | 2 +- .../General/Vector512/ConditionalSelect.Double.cs | 2 +- .../General/Vector512/ConditionalSelect.Int16.cs | 2 +- .../General/Vector512/ConditionalSelect.Int32.cs | 2 +- .../General/Vector512/ConditionalSelect.Int64.cs | 2 +- .../General/Vector512/ConditionalSelect.SByte.cs | 2 +- .../General/Vector512/ConditionalSelect.Single.cs | 2 +- .../General/Vector512/ConditionalSelect.UInt16.cs | 2 +- .../General/Vector512/ConditionalSelect.UInt32.cs | 2 +- .../General/Vector512/ConditionalSelect.UInt64.cs | 2 +- .../General/Vector512/ConvertToDouble.Int64.cs | 2 +- .../General/Vector512/ConvertToDouble.UInt64.cs | 2 +- .../General/Vector512/ConvertToInt32.Single.cs | 2 +- .../General/Vector512/ConvertToInt64.Double.cs | 2 +- .../General/Vector512/ConvertToSingle.Int32.cs | 2 +- .../General/Vector512/ConvertToSingle.UInt32.cs | 2 +- .../General/Vector512/ConvertToUInt32.Single.cs | 2 +- .../General/Vector512/ConvertToUInt64.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAll.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAll.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAll.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAll.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAll.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAll.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAny.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAny.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAny.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAny.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAny.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAny.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Floor.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Floor.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThanAll.Byte.cs | 2 +- .../General/Vector512/GreaterThanAll.Double.cs | 2 +- .../General/Vector512/GreaterThanAll.Int16.cs | 2 +- .../General/Vector512/GreaterThanAll.Int32.cs | 2 +- .../General/Vector512/GreaterThanAll.Int64.cs | 2 +- .../General/Vector512/GreaterThanAll.SByte.cs | 2 +- .../General/Vector512/GreaterThanAll.Single.cs | 2 +- .../General/Vector512/GreaterThanAll.UInt16.cs | 2 +- .../General/Vector512/GreaterThanAll.UInt32.cs | 2 +- .../General/Vector512/GreaterThanAll.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThanAny.Byte.cs | 2 +- .../General/Vector512/GreaterThanAny.Double.cs | 2 +- .../General/Vector512/GreaterThanAny.Int16.cs | 2 +- .../General/Vector512/GreaterThanAny.Int32.cs | 2 +- .../General/Vector512/GreaterThanAny.Int64.cs | 2 +- .../General/Vector512/GreaterThanAny.SByte.cs | 2 +- .../General/Vector512/GreaterThanAny.Single.cs | 2 +- .../General/Vector512/GreaterThanAny.UInt16.cs | 2 +- .../General/Vector512/GreaterThanAny.UInt32.cs | 2 +- .../General/Vector512/GreaterThanAny.UInt64.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.Byte.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.Double.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.Int16.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.Int32.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.Int64.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.SByte.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.Single.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.UInt16.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.UInt32.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.UInt64.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.Byte.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.Double.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.Int16.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.Int32.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.Int64.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.SByte.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.Single.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.UInt16.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.UInt32.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.UInt64.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.Byte.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.Double.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.Int16.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.Int32.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.Int64.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.SByte.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.Single.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.UInt16.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.UInt32.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.UInt64.cs | 2 +- .../General/Vector512/LessThanOrEqual.Byte.cs | 2 +- .../General/Vector512/LessThanOrEqual.Double.cs | 2 +- .../General/Vector512/LessThanOrEqual.Int16.cs | 2 +- .../General/Vector512/LessThanOrEqual.Int32.cs | 2 +- .../General/Vector512/LessThanOrEqual.Int64.cs | 2 +- .../General/Vector512/LessThanOrEqual.SByte.cs | 2 +- .../General/Vector512/LessThanOrEqual.Single.cs | 2 +- .../General/Vector512/LessThanOrEqual.UInt16.cs | 2 +- .../General/Vector512/LessThanOrEqual.UInt32.cs | 2 +- .../General/Vector512/LessThanOrEqual.UInt64.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.Byte.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.Double.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.Int16.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.Int32.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.Int64.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.SByte.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.Single.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.UInt16.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.UInt32.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.UInt64.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.Byte.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.Double.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.Int16.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.Int32.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.Int64.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.SByte.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.Single.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.UInt16.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.UInt32.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Max.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Max.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Max.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Max.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Max.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Min.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Min.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Min.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Min.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Min.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Narrow.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Narrow.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Narrow.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Narrow.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512/OnesComplement.Byte.cs | 2 +- .../General/Vector512/OnesComplement.Double.cs | 2 +- .../General/Vector512/OnesComplement.Int16.cs | 2 +- .../General/Vector512/OnesComplement.Int32.cs | 2 +- .../General/Vector512/OnesComplement.Int64.cs | 2 +- .../General/Vector512/OnesComplement.SByte.cs | 2 +- .../General/Vector512/OnesComplement.Single.cs | 2 +- .../General/Vector512/OnesComplement.UInt16.cs | 2 +- .../General/Vector512/OnesComplement.UInt32.cs | 2 +- .../General/Vector512/OnesComplement.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Sqrt.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Sqrt.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Sqrt.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Widen.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Widen.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Widen.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Widen.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Widen.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Widen.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Widen.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Xor.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Xor.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Xor.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Xor.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Xor.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Addition.Byte.cs | 2 +- .../General/Vector512_1/op_Addition.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Addition.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Addition.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Addition.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Addition.SByte.cs | 2 +- .../General/Vector512_1/op_Addition.Single.cs | 2 +- .../General/Vector512_1/op_Addition.UInt16.cs | 2 +- .../General/Vector512_1/op_Addition.UInt32.cs | 2 +- .../General/Vector512_1/op_Addition.UInt64.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.Byte.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.Double.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.Int16.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.Int32.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.Int64.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.SByte.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.Single.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.UInt16.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.UInt32.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Byte.cs | 2 +- .../General/Vector512_1/op_BitwiseOr.Double.cs | 2 +- .../General/Vector512_1/op_BitwiseOr.Int16.cs | 2 +- .../General/Vector512_1/op_BitwiseOr.Int32.cs | 2 +- .../General/Vector512_1/op_BitwiseOr.Int64.cs | 2 +- .../General/Vector512_1/op_BitwiseOr.SByte.cs | 2 +- .../General/Vector512_1/op_BitwiseOr.Single.cs | 2 +- .../General/Vector512_1/op_BitwiseOr.UInt16.cs | 2 +- .../General/Vector512_1/op_BitwiseOr.UInt32.cs | 2 +- .../General/Vector512_1/op_BitwiseOr.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Division.Byte.cs | 2 +- .../General/Vector512_1/op_Division.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Division.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Division.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Division.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Division.SByte.cs | 2 +- .../General/Vector512_1/op_Division.Single.cs | 2 +- .../General/Vector512_1/op_Division.UInt16.cs | 2 +- .../General/Vector512_1/op_Division.UInt32.cs | 2 +- .../General/Vector512_1/op_Division.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Equality.Byte.cs | 2 +- .../General/Vector512_1/op_Equality.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Equality.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Equality.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Equality.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Equality.SByte.cs | 2 +- .../General/Vector512_1/op_Equality.Single.cs | 2 +- .../General/Vector512_1/op_Equality.UInt16.cs | 2 +- .../General/Vector512_1/op_Equality.UInt32.cs | 2 +- .../General/Vector512_1/op_Equality.UInt64.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.Byte.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.Double.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.Int16.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.Int32.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.Int64.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.SByte.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.Single.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.UInt16.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.UInt32.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.UInt64.cs | 2 +- .../General/Vector512_1/op_Inequality.Byte.cs | 2 +- .../General/Vector512_1/op_Inequality.Double.cs | 2 +- .../General/Vector512_1/op_Inequality.Int16.cs | 2 +- .../General/Vector512_1/op_Inequality.Int32.cs | 2 +- .../General/Vector512_1/op_Inequality.Int64.cs | 2 +- .../General/Vector512_1/op_Inequality.SByte.cs | 2 +- .../General/Vector512_1/op_Inequality.Single.cs | 2 +- .../General/Vector512_1/op_Inequality.UInt16.cs | 2 +- .../General/Vector512_1/op_Inequality.UInt32.cs | 2 +- .../General/Vector512_1/op_Inequality.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Multiply.Byte.cs | 2 +- .../General/Vector512_1/op_Multiply.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Multiply.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Multiply.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Multiply.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Multiply.SByte.cs | 2 +- .../General/Vector512_1/op_Multiply.Single.cs | 2 +- .../General/Vector512_1/op_Multiply.UInt16.cs | 2 +- .../General/Vector512_1/op_Multiply.UInt32.cs | 2 +- .../General/Vector512_1/op_Multiply.UInt64.cs | 2 +- .../General/Vector512_1/op_OnesComplement.Byte.cs | 2 +- .../General/Vector512_1/op_OnesComplement.Double.cs | 2 +- .../General/Vector512_1/op_OnesComplement.Int16.cs | 2 +- .../General/Vector512_1/op_OnesComplement.Int32.cs | 2 +- .../General/Vector512_1/op_OnesComplement.Int64.cs | 2 +- .../General/Vector512_1/op_OnesComplement.SByte.cs | 2 +- .../General/Vector512_1/op_OnesComplement.Single.cs | 2 +- .../General/Vector512_1/op_OnesComplement.UInt16.cs | 2 +- .../General/Vector512_1/op_OnesComplement.UInt32.cs | 2 +- .../General/Vector512_1/op_OnesComplement.UInt64.cs | 2 +- .../General/Vector512_1/op_Subtraction.Byte.cs | 2 +- .../General/Vector512_1/op_Subtraction.Double.cs | 2 +- .../General/Vector512_1/op_Subtraction.Int16.cs | 2 +- .../General/Vector512_1/op_Subtraction.Int32.cs | 2 +- .../General/Vector512_1/op_Subtraction.Int64.cs | 2 +- .../General/Vector512_1/op_Subtraction.SByte.cs | 2 +- .../General/Vector512_1/op_Subtraction.Single.cs | 2 +- .../General/Vector512_1/op_Subtraction.UInt16.cs | 2 +- .../General/Vector512_1/op_Subtraction.UInt32.cs | 2 +- .../General/Vector512_1/op_Subtraction.UInt64.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.Byte.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.Double.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.Int16.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.Int32.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.Int64.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.SByte.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.Single.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.UInt16.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.UInt32.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Byte.cs | 2 +- .../General/Vector512_1/op_UnaryPlus.Double.cs | 2 +- .../General/Vector512_1/op_UnaryPlus.Int16.cs | 2 +- .../General/Vector512_1/op_UnaryPlus.Int32.cs | 2 +- .../General/Vector512_1/op_UnaryPlus.Int64.cs | 2 +- .../General/Vector512_1/op_UnaryPlus.SByte.cs | 2 +- .../General/Vector512_1/op_UnaryPlus.Single.cs | 2 +- .../General/Vector512_1/op_UnaryPlus.UInt16.cs | 2 +- .../General/Vector512_1/op_UnaryPlus.UInt32.cs | 2 +- .../General/Vector512_1/op_UnaryPlus.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Byte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.SByte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Single.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Byte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.SByte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Single.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector64/BitwiseAnd.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector64/BitwiseAnd.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Ceiling.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Ceiling.Single.cs | 2 +- .../General/Vector64/ConditionalSelect.Byte.cs | 2 +- .../General/Vector64/ConditionalSelect.Double.cs | 2 +- .../General/Vector64/ConditionalSelect.Int16.cs | 2 +- .../General/Vector64/ConditionalSelect.Int32.cs | 2 +- .../General/Vector64/ConditionalSelect.Int64.cs | 2 +- .../General/Vector64/ConditionalSelect.SByte.cs | 2 +- .../General/Vector64/ConditionalSelect.Single.cs | 2 +- .../General/Vector64/ConditionalSelect.UInt16.cs | 2 +- .../General/Vector64/ConditionalSelect.UInt32.cs | 2 +- .../General/Vector64/ConditionalSelect.UInt64.cs | 2 +- .../General/Vector64/ConvertToDouble.Int64.cs | 2 +- .../General/Vector64/ConvertToDouble.UInt64.cs | 2 +- .../General/Vector64/ConvertToInt32.Single.cs | 2 +- .../General/Vector64/ConvertToInt64.Double.cs | 2 +- .../General/Vector64/ConvertToSingle.Int32.cs | 2 +- .../General/Vector64/ConvertToSingle.UInt32.cs | 2 +- .../General/Vector64/ConvertToUInt32.Single.cs | 2 +- .../General/Vector64/ConvertToUInt64.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Floor.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Floor.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThan.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThan.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThan.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThan.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThan.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThan.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThan.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThan.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThan.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAll.Byte.cs | 2 +- .../General/Vector64/GreaterThanAll.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAll.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAll.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAll.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAll.SByte.cs | 2 +- .../General/Vector64/GreaterThanAll.Single.cs | 2 +- .../General/Vector64/GreaterThanAll.UInt16.cs | 2 +- .../General/Vector64/GreaterThanAll.UInt32.cs | 2 +- .../General/Vector64/GreaterThanAll.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAny.Byte.cs | 2 +- .../General/Vector64/GreaterThanAny.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAny.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAny.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAny.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAny.SByte.cs | 2 +- .../General/Vector64/GreaterThanAny.Single.cs | 2 +- .../General/Vector64/GreaterThanAny.UInt16.cs | 2 +- .../General/Vector64/GreaterThanAny.UInt32.cs | 2 +- .../General/Vector64/GreaterThanAny.UInt64.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.Byte.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.Double.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.Int16.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.Int32.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.Int64.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.SByte.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.Single.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.UInt16.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.UInt32.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.UInt64.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.Byte.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.Double.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.Int16.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.Int32.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.Int64.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.SByte.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.Single.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.UInt16.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.UInt32.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.UInt64.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.Byte.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.Double.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.Int16.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.Int32.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.Int64.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.SByte.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.Single.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.UInt16.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.UInt32.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAll.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAll.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAll.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAll.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAll.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAll.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAll.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAll.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAll.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAny.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAny.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAny.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAny.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAny.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAny.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAny.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAny.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAny.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanOrEqual.Byte.cs | 2 +- .../General/Vector64/LessThanOrEqual.Double.cs | 2 +- .../General/Vector64/LessThanOrEqual.Int16.cs | 2 +- .../General/Vector64/LessThanOrEqual.Int32.cs | 2 +- .../General/Vector64/LessThanOrEqual.Int64.cs | 2 +- .../General/Vector64/LessThanOrEqual.SByte.cs | 2 +- .../General/Vector64/LessThanOrEqual.Single.cs | 2 +- .../General/Vector64/LessThanOrEqual.UInt16.cs | 2 +- .../General/Vector64/LessThanOrEqual.UInt32.cs | 2 +- .../General/Vector64/LessThanOrEqual.UInt64.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.Byte.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.Double.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.Int16.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.Int32.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.Int64.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.SByte.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.Single.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.UInt16.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.UInt32.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.UInt64.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.Byte.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.Double.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.Int16.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.Int32.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.Int64.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.SByte.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.Single.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.UInt16.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.UInt32.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Byte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.SByte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Single.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Byte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.SByte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Single.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Narrow.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Narrow.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Narrow.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Narrow.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/OnesComplement.Byte.cs | 2 +- .../General/Vector64/OnesComplement.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64/OnesComplement.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/OnesComplement.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/OnesComplement.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/OnesComplement.SByte.cs | 2 +- .../General/Vector64/OnesComplement.Single.cs | 2 +- .../General/Vector64/OnesComplement.UInt16.cs | 2 +- .../General/Vector64/OnesComplement.UInt32.cs | 2 +- .../General/Vector64/OnesComplement.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Sqrt.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Sqrt.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Widen.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Widen.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Widen.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Widen.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Widen.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Widen.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Widen.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Byte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.SByte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Single.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Byte.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.Double.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.Int16.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.Int32.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.Int64.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.SByte.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.Single.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.UInt16.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.UInt32.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Byte.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.SByte.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.Single.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.UInt16.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.UInt32.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.UInt64.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.Byte.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.Double.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.Int16.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.Int32.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.Int64.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.SByte.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.Single.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.UInt16.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.UInt32.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Inequality.Byte.cs | 2 +- .../General/Vector64_1/op_Inequality.Double.cs | 2 +- .../General/Vector64_1/op_Inequality.Int16.cs | 2 +- .../General/Vector64_1/op_Inequality.Int32.cs | 2 +- .../General/Vector64_1/op_Inequality.Int64.cs | 2 +- .../General/Vector64_1/op_Inequality.SByte.cs | 2 +- .../General/Vector64_1/op_Inequality.Single.cs | 2 +- .../General/Vector64_1/op_Inequality.UInt16.cs | 2 +- .../General/Vector64_1/op_Inequality.UInt32.cs | 2 +- .../General/Vector64_1/op_Inequality.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt64.cs | 2 +- .../General/Vector64_1/op_OnesComplement.Byte.cs | 2 +- .../General/Vector64_1/op_OnesComplement.Double.cs | 2 +- .../General/Vector64_1/op_OnesComplement.Int16.cs | 2 +- .../General/Vector64_1/op_OnesComplement.Int32.cs | 2 +- .../General/Vector64_1/op_OnesComplement.Int64.cs | 2 +- .../General/Vector64_1/op_OnesComplement.SByte.cs | 2 +- .../General/Vector64_1/op_OnesComplement.Single.cs | 2 +- .../General/Vector64_1/op_OnesComplement.UInt16.cs | 2 +- .../General/Vector64_1/op_OnesComplement.UInt32.cs | 2 +- .../General/Vector64_1/op_OnesComplement.UInt64.cs | 2 +- .../General/Vector64_1/op_Subtraction.Byte.cs | 2 +- .../General/Vector64_1/op_Subtraction.Double.cs | 2 +- .../General/Vector64_1/op_Subtraction.Int16.cs | 2 +- .../General/Vector64_1/op_Subtraction.Int32.cs | 2 +- .../General/Vector64_1/op_Subtraction.Int64.cs | 2 +- .../General/Vector64_1/op_Subtraction.SByte.cs | 2 +- .../General/Vector64_1/op_Subtraction.Single.cs | 2 +- .../General/Vector64_1/op_Subtraction.UInt16.cs | 2 +- .../General/Vector64_1/op_Subtraction.UInt32.cs | 2 +- .../General/Vector64_1/op_Subtraction.UInt64.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.Byte.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.Double.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.Int16.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.Int32.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.Int64.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.SByte.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.Single.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.UInt16.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.UInt32.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Byte.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.SByte.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.Single.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.UInt16.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.UInt32.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.UInt64.cs | 2 +- 1837 files changed, 1837 insertions(+), 1837 deletions(-) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBinaryOpTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBinaryOpTest.template index 9fcc5929cacc6d..081be7d0e3cf96 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBinaryOpTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBinaryOpTest.template @@ -73,7 +73,7 @@ namespace JIT.HardwareIntrinsics.General int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBinaryOperatorTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBinaryOperatorTest.template index 02a466446bd8b7..f0e47a2b4b55da 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBinaryOperatorTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBinaryOperatorTest.template @@ -73,7 +73,7 @@ namespace JIT.HardwareIntrinsics.General int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAllBinaryOpTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAllBinaryOpTest.template index e161eda6917716..62d2e7d49373b2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAllBinaryOpTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAllBinaryOpTest.template @@ -70,7 +70,7 @@ namespace JIT.HardwareIntrinsics.General { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAllBinaryOperatorTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAllBinaryOperatorTest.template index 3ce4c08b07067c..b643a1bf3bda68 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAllBinaryOperatorTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAllBinaryOperatorTest.template @@ -70,7 +70,7 @@ namespace JIT.HardwareIntrinsics.General { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAnyBinaryOpTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAnyBinaryOpTest.template index b13e991ff93443..a301ffc46248d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAnyBinaryOpTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAnyBinaryOpTest.template @@ -70,7 +70,7 @@ namespace JIT.HardwareIntrinsics.General { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAnyBinaryOperatorTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAnyBinaryOperatorTest.template index 8886e484b8bdbb..e631b99981027c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAnyBinaryOperatorTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAnyBinaryOperatorTest.template @@ -70,7 +70,7 @@ namespace JIT.HardwareIntrinsics.General { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorConvertToTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorConvertToTest.template index 8a282e1f286d28..1c6f4bb5226e8f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorConvertToTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorConvertToTest.template @@ -70,7 +70,7 @@ namespace JIT.HardwareIntrinsics.General { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorDotTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorDotTest.template index c1db9b9050f42d..547780ee4a23b0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorDotTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorDotTest.template @@ -70,7 +70,7 @@ namespace JIT.HardwareIntrinsics.General { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorNarrowTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorNarrowTest.template index cf51a67a44f11d..192bdd45bb2a8c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorNarrowTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorNarrowTest.template @@ -73,7 +73,7 @@ namespace JIT.HardwareIntrinsics.General int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorTernaryOpTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorTernaryOpTest.template index c3f02db8c52729..4477e47971a7e0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorTernaryOpTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorTernaryOpTest.template @@ -76,7 +76,7 @@ namespace JIT.HardwareIntrinsics.General int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<{Op3BaseType}>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorUnaryOpTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorUnaryOpTest.template index 5a6a1a1ccc70db..52ffd0209a5e63 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorUnaryOpTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorUnaryOpTest.template @@ -70,7 +70,7 @@ namespace JIT.HardwareIntrinsics.General { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorUnaryOperatorTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorUnaryOperatorTest.template index 9dc5f9a49bb25c..d1283c3ebd8720 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorUnaryOperatorTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorUnaryOperatorTest.template @@ -70,7 +70,7 @@ namespace JIT.HardwareIntrinsics.General { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorWidenTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorWidenTest.template index 07a350060623c2..ac48a3bd5e7bd8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorWidenTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorWidenTest.template @@ -73,7 +73,7 @@ namespace JIT.HardwareIntrinsics.General int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf<{RetBaseType}>(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Byte.cs index c90ef73bde81b3..b354e05f9540c6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Double.cs index 39df712f047bbb..172c030ab433ed 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int16.cs index 3c0cc77563f915..afb771426afad5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int32.cs index f5c38e174ddc37..3340e7d0222fef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int64.cs index 4afbe8fabd1e09..42e091c3143f40 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.SByte.cs index 62741fe71bb97e..21091de0c7c0a4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Single.cs index 74c33888fed69a..654e9bf002de64 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt16.cs index fc09bd6ccbf0c0..15546b956193e1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt32.cs index 4456d04a9f86d5..4aab00b70a2fb2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt64.cs index 055bc389676b19..cf7b26e7b04cc2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Byte.cs index edb167ee7013bd..baba042950e4a8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Double.cs index 1324cd83ba689e..d3de29d896fc7c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int16.cs index 247b3cc6f6011c..2b78899ddf1d0f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int32.cs index 37076fafe4970d..b5f285b3d55dd6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int64.cs index 1381f64a81b2e6..3c6786bcfdcd08 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.SByte.cs index 02124abf29616c..8fa28868af0fdf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Single.cs index d3f17641ce5d17..d1891801e7f6a6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt16.cs index bae4bc57cd3fa8..a2890444fbe0f9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt32.cs index 06bcab41e3b71e..476ac7a6a3ba93 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt64.cs index fa710e59ccf60e..0142ee75c164e2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Byte.cs index 305481065cd900..31a70ef6dd210d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Double.cs index fb2ed8424ea7f1..cc3cbd010a509d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int16.cs index 6a060ac07b4d69..7ef28b15652807 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int32.cs index 414100a3f35ff3..bfbb747119175f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int64.cs index 95a0841a3f07f2..3df68fc084f5a9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.SByte.cs index 91e9c67e530687..653a6bff0cd207 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Single.cs index 0e59cc59ec4ccd..f2546ac6c9848a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt16.cs index f3019686820c1f..e1fc4e57d3412d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt32.cs index 7454d5a76e7037..a6a014f428fc0a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt64.cs index ff4306f10f8974..134dfa4de22876 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Byte.cs index 2dbec5f21d5d89..aadf92bbbf8bd6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Double.cs index e7d81f1e4a2d29..9a1d44d91af35a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int16.cs index 3b3f19e037d838..9c268be925176c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int32.cs index 812de3673a8a83..db40c9ef60b1f6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int64.cs index a1979a1a54ab5d..25ca36d3e8ef95 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.SByte.cs index 3151be099cca70..06b8a51cbf3c51 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Single.cs index db9b160dcfbd1e..fb5ac4ecfeb31a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt16.cs index fcccde59ccee40..4de16a6179e9e1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt32.cs index d3e76ac7d259b7..29f83d824a40ae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt64.cs index 3d1de997692500..d3d0b04c3aca94 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Byte.cs index 35b3c8c3e23af3..0e636d8208521c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Double.cs index 65b19d3a490b9c..cd7ec81bd4f503 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int16.cs index 8c8cc9691df0ff..607e28c08142ba 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int32.cs index 7cdd7d9c8ed8f4..17b2f97f6e403d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int64.cs index 3a5ffbd4c079c2..f8d06a37981a0f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.SByte.cs index 26b2944525ee73..0473bc2ea647e5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Single.cs index d412ab1ff76925..3e0636745c4662 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt16.cs index d2484b533dcf4c..267411eb74b698 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt32.cs index 9e61d64c898717..c1bfb66f606cfd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt64.cs index 0f8adde32fc106..52f24ab2b80c8e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Double.cs index 9f14dca16fd2e0..582ad31eb85b77 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Single.cs index 3258ff3b9a50c4..aca473bc3d6f42 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Byte.cs index d716026c024d88..6eaa3edc0275d6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Byte.cs @@ -76,7 +76,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] inArray3, Byte[] outAr int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Double.cs index 2cb7f6467a3d36..2cf512e75cfe3e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Double.cs @@ -76,7 +76,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] inArray3, Double int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int16.cs index dc9d9784c9f0fa..ffa7ea1e61ac70 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int16.cs @@ -76,7 +76,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int32.cs index 52c13e326be9ee..bc42ecdcf3a67e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int32.cs @@ -76,7 +76,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int64.cs index d33225f33baf67..0f828aa0577b0b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int64.cs @@ -76,7 +76,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] inArray3, Int64[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.SByte.cs index 95c230394271c6..5d87eea804ba5a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.SByte.cs @@ -76,7 +76,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] inArray3, SByte[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Single.cs index a06583b80e5126..132bd3fe355f1e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Single.cs @@ -76,7 +76,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt16.cs index b649828a8c5852..dabffb044cc024 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt16.cs @@ -76,7 +76,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] inArray3, UInt16 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt32.cs index 521721bf54324a..3d44551cd35d3f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt32.cs @@ -76,7 +76,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] inArray3, UInt32 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt64.cs index 65139843e51659..d8e1905aa72a2c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt64.cs @@ -76,7 +76,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] inArray3, UInt64 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.Int64.cs index ffe4f5f83d5899..a28b50d0315387 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.UInt64.cs index 880291c0005254..7a1f2575d56bfb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt32.Single.cs index 21eb7a18abec61..8f07c09ce24c01 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt64.Double.cs index 6abf6f55123b61..fdcd093afa138e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.Int32.cs index 3daa511ca4e7fc..339d8ce6a8569c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.UInt32.cs index de0401985b24dd..97355604913282 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt32.Single.cs index fdc9f3005cfc3f..60d2cfd6cfc180 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt64.Double.cs index 195f11d4884b16..846e21ce45d216 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Byte.cs index ab099d5577d3d9..d8f85f00faaab4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Double.cs index 1bd2edbe753efb..36931185ad2c78 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int16.cs index ef0d6184e4c5cb..881a73733a3b12 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int32.cs index 5ee42fe8daa23a..c5790d1695b433 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int64.cs index b03d9a0b31ccab..9e0b7d0d3381a7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.SByte.cs index 22ab921eece48a..839dd043317b7f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Single.cs index 8f6117a25b8190..d17e5948a36a58 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt16.cs index 18ff84b7b6a5e7..78f97d1d40f61a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt32.cs index 3ab787aaf189ff..aec20a10cc3513 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt64.cs index 817f05e1d91297..cd864096d6fa73 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs index 7b379ca30f7f18..99bbfe8731d29c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs index 0c181839059394..7efe42656d4881 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs index 749c5bda7378d7..dd9bb64e7453cf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs index 95f0de0e628bad..953acc6a04eec7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs index 9f8c44c0df4532..2271a66d11e442 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs index 5030c06dbe5b81..465a800b43bd5c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs index a51281d6c08915..02608cb7a0988d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs index c1f73aa74a96ce..0b01ba2fc7c869 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs index bf8be929170872..801545dc3e9f31 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs index 6f610e0c19f1c3..e45936decd417e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Byte.cs index ac2bdce0c2bbcd..d371c60b4bc2b8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Double.cs index 020c5706eef30d..f8e04ef14af990 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int16.cs index c0faf7c9744010..992c6511da902d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int32.cs index 7020ae6484d4ea..680f0fb727468f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int64.cs index 439557a49c3bd8..9cfa177fcdadb0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.SByte.cs index 83c362af070957..74d7513b10ffc8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Single.cs index 9e16406c71c71a..038c409d2c182c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt16.cs index 6e8e34831d027d..51f9d09b09fc22 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt32.cs index 79bd8701647046..a9cc7f1e4c46c6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt64.cs index d1cf2e004aa5e6..e3b9db2b57f34a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Byte.cs index 1a404ca8b296dc..bccf4a18ed6393 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Double.cs index 39d260143b9663..8774fea64e1836 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int16.cs index 1fca35f4368743..522706cf189110 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int32.cs index d737a7b3ed17ab..18e88f783214fc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int64.cs index af0f52e50cf5fc..866c47e4502034 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.SByte.cs index 67ae2d41c2567d..6de7e518f49302 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Single.cs index 471e8c92f8f50a..4c0b269877232a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt16.cs index 31ae317a892eb7..9ce78fbf047f8f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt32.cs index 3281882448d8f4..f7616e14d3b2a9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt64.cs index 07838e36234bc8..d44c021e9f2522 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Byte.cs index 2725f0d192a387..3865098080bec5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Double.cs index 08583a15bbed09..c36d6d78f90fd5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int16.cs index 6cc0be0a0e41ec..1366153e4b8dc6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int32.cs index 75817d0097f40b..25c5c13ab57e6b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int64.cs index fa235a129f676e..6871e748853a81 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.SByte.cs index 3d938f1de4b16c..91bcece3241ba0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Single.cs index bfca3450c7d96b..2e5001a559b7de 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt16.cs index ffa2fbdc642bdc..20fea410e04fa0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt32.cs index 0c9ff5c03083e0..423f008796f3f7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt64.cs index 4b952804f00e45..712948ef5e62f3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Double.cs index bd8f3f8da9fda1..aedde51341ac02 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Single.cs index ad25892c97f45c..c5e1de336bfb1e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Byte.cs index dcf196d069bbf3..949b258b5cb381 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Double.cs index 81fe64a1aa49c6..4ffde433ad9887 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int16.cs index 29da672e964c1f..39154363e9e2c6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int32.cs index f2c4df6848a481..5578505483b18b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int64.cs index 7a8d2a25d2d74f..51e6b64cb4644b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.SByte.cs index 8c3682780006f8..78d29864aab466 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Single.cs index a79066950e6026..15d8fbd80c1b49 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt16.cs index 32889b3a4d0969..8d15fdb9a39c2e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt32.cs index 557974928c0eb8..8107d5c0fdadf5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt64.cs index 6051adabc0912e..aab452190c725f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Byte.cs index 0eb76f8113c8f3..404f2d1a0b36ff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Double.cs index 8b489bb594fa61..9b3c12ac9ef76b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int16.cs index 9f60ad63141dd5..94a848b05d2ca2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int32.cs index ab01213b9aa126..04cc56397e7bf6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int64.cs index 3df99374385e47..b0ee8ff6ff0eff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.SByte.cs index 7dd41c6e750c29..dffde7e0e753af 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Single.cs index e74825c96117a5..7bd63fd41fe950 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt16.cs index c4e181f431e656..6b3decfdbb82a1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt32.cs index b7f43c8b7f237f..4a022aee3fc373 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt64.cs index c64809ff17aea7..6032ba9a143a16 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Byte.cs index a8faae908f3676..f9b3d3e1bacf70 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Double.cs index adf0ec9de3de08..12dbf25348acec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int16.cs index 6c437b1fbce1d2..51f2950daa3fc6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int32.cs index fab1b9b9af6c2b..df6e2ad6966d09 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int64.cs index 4632c18a421227..3f96b249009521 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.SByte.cs index c6d6636cbaa83b..d5238b36fd13de 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Single.cs index 49ee78917452e6..c030910e29066c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt16.cs index fafa5c1d488313..cbe6bc2961f421 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt32.cs index 413e515705ea85..5a6ee894cff569 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt64.cs index 257f8af1978c95..d766b0aeea6866 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Byte.cs index 1a344fc7db1dd1..600fba9b53a4a0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Double.cs index b12f722d460298..f801327229caed 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int16.cs index d85de4b05ba6bf..521aea88c6c670 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int32.cs index 09c6597a2768b7..fe1df4c7ec04d1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int64.cs index 340ad93eda8efb..f631ae3dcd942f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.SByte.cs index ea250dcded4125..ef287886e3d181 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Single.cs index df47ca084b0aca..74a2faef48e823 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt16.cs index a4e84c10d9c677..e7f590432d663f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt32.cs index 4ec9c5cf5fb141..59da5775c72376 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt64.cs index 6d7a30275b2edc..ecbd110275343c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Byte.cs index 9d09d3b2e0e069..16210dedebbdf8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Double.cs index 19ff3bc8be4116..2aedd149c915c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int16.cs index e7ef49e817374a..980f9a55946d7b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int32.cs index 9724d5c1c7a405..1d53866825a25b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int64.cs index a9650dad879d04..ea5daf586fdc32 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.SByte.cs index 1fdefcdf76b2df..afa483f2c719ad 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Single.cs index 213a9fb3592d4c..e96ad7e76aa827 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt16.cs index 26561cca715dfa..3520f870b3bedd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt32.cs index 3c7b266b379401..235bee52ad5f6e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt64.cs index d597dc99b8747a..066210bc69904e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Byte.cs index 14d3b36ee82c4c..61187dfae43f55 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Double.cs index a12b7151a9180f..2e529281797b58 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int16.cs index c82c22c7922751..9ddfe14d584038 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int32.cs index e7cd56d0b26894..626891832eb050 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int64.cs index ca8e93243d1a95..5ffbf6b0c9d403 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.SByte.cs index d45e324cd0132f..48c43e65777257 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Single.cs index 477d1e47b7e485..5e0745da3db755 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt16.cs index 6745c32d8dc4dc..9f3b6fbf167523 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt32.cs index 67dcc6084a2f96..44746700b758d0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt64.cs index bc1ea61745dd75..4a7e2cec036cf3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Byte.cs index 0aed93ce1d9f3e..a72d55a967a11d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Double.cs index 08311ec95f66f9..4a995254fdb09f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int16.cs index 2f7446c73dff9f..8350d398b9b344 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int32.cs index 5bfc55c9f7aa5f..037054a6cd3c2b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int64.cs index dec4ba4e1e30e5..2d60812e417370 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.SByte.cs index d41955104e120c..83ee17ccd608b8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Single.cs index 9afc0304debd5a..83ce305c9cb947 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt16.cs index adfb6cb83fe14e..48db6c6932f484 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt32.cs index 1acadc53477643..89a7262f132976 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt64.cs index c18f9dc8472179..d17a85f9ee0d80 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Byte.cs index e93551b508bee8..94e70de8202b2b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Double.cs index 56890bfd8f56c4..deaa71eb813351 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int16.cs index 7f7fab89019e81..6e204338bbf672 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int32.cs index 5669191dc0468f..dc796b948a7c0f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int64.cs index 0c9c59d659c770..e3bf0b1d601196 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.SByte.cs index 2ab812a70e0939..a9fd57e42c5476 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Single.cs index 25de175ca3b0d0..9c4b1f0e810c96 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt16.cs index 482a8d0cf57c63..78f295b591b809 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt32.cs index c8f6b8b845be2a..ec91407dee0ce7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt64.cs index 80afcc46740da7..398b9dc456347d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Byte.cs index 6e550b543871bb..a6252a56763dd2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Double.cs index 793207e8b1b620..5b7852d1a50a80 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int16.cs index 5d8f4e57c65256..c577dea6f4c030 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int32.cs index c8d61271fb3353..1ca530ff92caa5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int64.cs index a204e128d640da..2091868dbdc07d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.SByte.cs index 9c623378adfe44..43b103ac17660a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Single.cs index 387363272c86b7..98c6f6c588c0a1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt16.cs index d13f30b60aeb36..eff32c4b35b6a3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt32.cs index 0cb59c88e73280..8752fc4e63b142 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt64.cs index c42aa490cac6e0..6c9efa04854ed2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Byte.cs index 207acd3aae543e..d919a1b5898b82 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Double.cs index 98170bb743bb64..381ac73bc706f4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int16.cs index 72f1317b186232..c10417aecc7aa3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int32.cs index f82ce0c9f6862c..d37213519c394d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int64.cs index 00965568023274..59b2f566732c8a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.SByte.cs index 6db62ae3fae703..7ddb03549d9eb2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Single.cs index f9a5168c59f86a..c5f06574511524 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt16.cs index 9f015d71694cec..09bb219895e22f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt32.cs index 3a3b068f7a341b..5979152fdf4280 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt64.cs index f5294c3e06c6e4..810c21af414569 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Byte.cs index ee03e315066660..7ab19aa0be2c20 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Double.cs index 1b185d8135a96e..ee6c4ec6e9bc92 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int16.cs index 7e0d0f98b6c9d9..636ecbd61fd40e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int32.cs index 21ac788303decb..413c896b761c2f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int64.cs index f868bf6eece6a9..c6c11cfb0758c3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.SByte.cs index 7a7bed6d14b2e1..8a283499cfdd97 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Single.cs index ea20ead9dba91e..68647673c40751 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt16.cs index 6a8a90a0824c0d..8ba88ba60038f9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt32.cs index 50f8b9a81e08fd..db27067d242573 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt64.cs index 11d1dd2dabb632..6881cb93660a8b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Byte.cs index 21a42ee4433bbf..22686c93d44aa1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Double.cs index 1223b42d0b3fec..210c9eda5d44f3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int16.cs index da9cfcb741e949..8db33773d5ddd2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int32.cs index d0709226e90f0d..00a36594720cfd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int64.cs index 9041636eaba808..a9e7f83c105713 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.SByte.cs index c0d4df2747bc32..6ab20b44ca070e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Single.cs index 9c5cb438f073e7..570b9d7f6b4bb9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt16.cs index 59c0ee12acf253..5a9ecd6487dc98 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt32.cs index 309ea2f4f46612..096e3e50c18602 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt64.cs index c47b7d71ef5289..27eb52c1e5c805 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Byte.cs index 96f17ff33df891..68c8a27c97e136 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Double.cs index 931b02e1c9d21a..b5358fe7e0e0e2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int16.cs index 9800b8a4029d56..5e2ac793cad2a2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int32.cs index d1b52eb2f728ae..8062de944797c8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int64.cs index 4bcf27d2a27beb..e7ea428e5dc4a0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.SByte.cs index 36fcab72c2b38c..cb26ecca10fb9a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Single.cs index 9b3583b8851d50..5044e71dcceea1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt16.cs index ac7f9329523ffb..c74d90457c690e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt32.cs index 0f00fff59d4a64..3e6ea8b97943dc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt64.cs index cc197a68ecfff8..bb37531d72c254 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Byte.cs index be9a7453c6c8e0..a0f6ce709c2bf0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Double.cs index d25f88cdc8260a..b3b2212768758d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int16.cs index ef0b4d8c94abc6..a7b8add679e197 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int32.cs index 36eccb443d9db3..6860c38cdb474b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int64.cs index cc1cd68577805a..17825bb4aeeadf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.SByte.cs index 53662266943b87..75eb3b2aae5277 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Single.cs index f3bf7c44a8b3c7..d4271eeabe434c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt16.cs index 301fb1471474fd..61812a7b86f5f7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt32.cs index 723bfd045f1537..c5126f83b25a82 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt64.cs index 075e40b3558741..a2bc4d7ca50782 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Byte.cs index 30fc0dec042fb3..d5e542c3121bad 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Double.cs index cd721115b58556..fbb64044c288d9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int16.cs index 1982806e2e5963..ea5dd38a19f857 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int32.cs index d87372957542d2..63f129385c448e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int64.cs index 48417e5ab6e00a..f00ced095327b0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.SByte.cs index 883157b69966bc..4d8aad15ea7154 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Single.cs index 764cb5fbf46950..6de01e64940692 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt16.cs index 77c4f8a636ff18..ccac89cdd304d8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt32.cs index c4e5f639ca2311..1a1b5669ba3406 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt64.cs index 0a91453b868bc3..ad065e5521eedf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Double.cs index 316a4bffbfeef5..62d5dd3643f420 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int16.cs index 7ffcaebe7fde19..d0918510e7dc23 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int32.cs index 7b31df9d40f247..e79bf46ec73dd7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int64.cs index 92c031e380f0dc..baaea24a631c10 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt16.cs index ce5a332667bcb4..d04196112ebaac 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, Byte[] outArray, int alig int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt32.cs index 1ca2b8c5dbaf72..ecf9576d10b8b9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt64.cs index 6767c399898dce..0e16a31c7a934d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Byte.cs index 25d9d9406267cb..f070fddb22fd71 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Double.cs index a5674091f640ad..0f6d1f5fdc804c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int16.cs index e7e098faa15073..25ebba90c7fd7b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int32.cs index 79512cc63bd64a..6047831ac9047f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int64.cs index 034faa0857623d..4e766257283f9e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.SByte.cs index 814fdb7cf2beac..4989c9f5aa4c3d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Single.cs index 9d54008ae1366d..83860257c10d67 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt16.cs index 90404bebcda23c..784901c7e01e5b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt32.cs index bef31c013cb71f..7fa843ccee4a74 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt64.cs index 3ed9fc42091e64..040146186d9aae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Byte.cs index 10849f9bc074e9..2074a90fb493e1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Double.cs index 8c4391aa7dfa72..abb4e5fad8569a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int16.cs index 783e528f21c78a..e4ca95d4011a07 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int32.cs index 79ee53400150e0..b38e6bc881ea47 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int64.cs index f4dbc8fa6a00df..03bb9888dc283e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.SByte.cs index fb6f18ba574ba7..25f5e5fdb67873 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Single.cs index 06aa8b81549c8e..45f37b00af178c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt16.cs index 1869b927447bfd..9d5a4bf2740b0a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt32.cs index 76b2b650cdf13f..c31380f638932a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt64.cs index 3d8ca36c5ba4f6..ef882ad119dd95 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Byte.cs index 23fe4592b3b7d4..8fa8660be9ba98 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Double.cs index 598cf517ed9cdd..e90ac60c713fa3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int16.cs index 9493123ea13346..690def7db47a8c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int32.cs index 145a23d5656434..de7668c0993033 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int64.cs index 87df1ea923c978..be80cd5ab4ab94 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.SByte.cs index 0d684b2bb98154..209bfd91113e70 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Single.cs index 3ec8b90aea139b..8816c13e8a99bf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt16.cs index f4fa9dd74ace2a..1c433ba2813fcd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt32.cs index 55aacd58d3844a..862fc8dd6fc6e9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt64.cs index 61f3c627e5c6ef..23e8b7589c9b3c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Byte.cs index 07742b8edac3ef..b275f332fb819e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Double.cs index 0e0beaeec4ea74..08e8cb5104e2ba 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int16.cs index 62e55e714e7e18..c215c5e7f33fcd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int32.cs index a9462a00cb7d16..a1e02e6f0c56a6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int64.cs index d1b8401b3fbe71..e9705961d108af 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.SByte.cs index 12e064ee1db653..2e33d657af8541 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Single.cs index eabbe1f13d30aa..8a79b4b71f548c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt16.cs index f6263b5a75b74f..e427ecef966a78 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt32.cs index 04472582afad88..16707ab9e600f2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt64.cs index 8ddbbdc7babaa8..d58992ae006c40 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Double.cs index d865ea93622dd9..162454889e396e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Double.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Double[] outLowerArray, Double[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int16.cs index dd0f11abd8a026..d22a9e7e9d733e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int16.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, Int16[] outLowerArray, Int16[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int32.cs index fe24461e0ee256..8ad165f973bc9e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int32[] outLowerArray, Int32[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int64.cs index 396b831e83b6aa..3b345a153f3c79 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int64[] outLowerArray, Int64[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt16.cs index c6da633cb396a0..5924c11d53b135 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, UInt16[] outLowerArray, UInt16[] outUpperArray int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt32.cs index bf946ba93a858e..d9292b734396a1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt32[] outLowerArray, UInt32[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt64.cs index 08f751532ad921..6575833d316691 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt64[] outLowerArray, UInt64[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Byte.cs index cd7736a90c83e7..acc49aa40796db 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Double.cs index 91227dcfe950bb..550b4e7c9a9aa0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int16.cs index e16f27f2435090..e237f406251f4a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int32.cs index c1dbce0930fb20..824089c27f4874 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int64.cs index f26579d9372ae2..b65107b3065891 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.SByte.cs index 7ca5b7e2fb9d36..d35c1af64edcda 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Single.cs index 87691e6619d2be..e50b922a328366 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt16.cs index 0da277232aca72..89db57c4fa62c4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt32.cs index ac0fa9425222ad..31c0c4ca987b3d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt64.cs index 5a5abf82556ce4..41b27597af7524 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Byte.cs index f63161cd05f3d0..dcf60f00174b7b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Double.cs index 2e703e27eb194d..4ea4912a602a3b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int16.cs index b68bee5d3ac0c2..1486104eac9623 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int32.cs index 4bbd162192e7dc..13732e90ca4e52 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int64.cs index eb48c56166eb1a..5dd37bbd2d3a21 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.SByte.cs index 45967f3c3a8a54..0195302e814d6d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Single.cs index f47dc8f4e0ca13..74b5a5bc43d5ab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt16.cs index 108916ce746ca2..8454d3c484edef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt32.cs index 1cc72f3b976b57..5267b090b9bc04 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt64.cs index 32d4ca0d814ccc..d3b06bf18d356a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Byte.cs index e23f664e76c63b..437552617317d4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Double.cs index aa04105b7e88ba..94c0be659211af 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int16.cs index 565e173d1444e5..ec85f0e7d42843 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int32.cs index 42ce5c4100aaf2..40d791a5ace111 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int64.cs index 23252d10fb7b96..47984b82d773d4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.SByte.cs index 75127a38860658..b5e466386e7103 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Single.cs index fd7bed3d62f8fb..c3a42cd096fd65 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt16.cs index b804a82bbdd262..53d79092bb836b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt32.cs index a388838307bebc..11d43c44b4fa7c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt64.cs index 000ce40831f3ca..90d59096e456bc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Byte.cs index 95602aec1b7ced..e9ae725614ece4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Double.cs index 13437ed7957f97..1864d9461d477a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int16.cs index ed4cd116ba30e0..8b03219c7b8573 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int32.cs index a4f048b79a4fc8..03c3778516cedb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int64.cs index 5a46a78c59fa6b..be8181fc67a6af 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.SByte.cs index e17a8376a8b9a0..3db51f2473c064 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Single.cs index 09d833b157623c..b55d8e7b931819 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt16.cs index 905eaaaad96265..1529da0f39bdcb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt32.cs index 31ea3b66dcc21d..3f40078543d6fd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt64.cs index 2a74ce7e2bc842..514c4395c2a704 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Byte.cs index c0f89a054c972e..a5346c88efe371 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Double.cs index a0fab334226977..5ae3bc769f22a8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int16.cs index 15fb641652637d..e980d58450bbc6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int32.cs index 1bb172b9affcc3..08df8da75ed1c1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int64.cs index 0581ed5e82cc00..52014358aac05e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.SByte.cs index a6014ed9f875f9..579c90236112df 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Single.cs index 608dc6b7b7ea63..72d7dae99099d7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt16.cs index ab1feaebdace73..a96e46e488f523 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt32.cs index 60aa7fa5b40375..d26e6d985e557a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt64.cs index 9d03ffc3e4df96..f322cc47301012 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Byte.cs index 3c979dee80448f..260d96034e1c64 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Double.cs index c02b52b9c71afb..7518a01ea29a6a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int16.cs index b0a48606cdca46..1a8c1d755e4a6f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int32.cs index e5263a8f6af562..8e11218ac8926e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int64.cs index 6e448381f9fdf1..77427570080009 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.SByte.cs index 17a4e91a075806..f20e9b519c9c32 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Single.cs index b2fdf83ea35d60..dce562e0fd5638 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt16.cs index ab40b64701b9d6..48ed6feb4dc552 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt32.cs index a63bd05722cf50..78e5a29e6a826e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt64.cs index 8c36fe758abce5..dc91bc4d3fe2e9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Byte.cs index aa28b5af2e5c5a..7ed248da06aa1e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Double.cs index 024c9604576498..87eabdb285bc59 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int16.cs index 358dd26fe55d15..00ab0c44e945f0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int32.cs index b96e6e18880935..f893f922034aa2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int64.cs index f481e4f0f78f86..d7cca68a17a402 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.SByte.cs index 0cdf7ef8693862..23e1c771ba936b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Single.cs index 8a7f0f43806ba2..cb4d118ba3332d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt16.cs index d57e02178caab5..b8b63243020801 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt32.cs index 1f547fb3d1bfaf..5de8ad866b244f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt64.cs index e0d5f5d1753883..3c8923f45b6425 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Byte.cs index 3a90d4c05c5a0c..42476f9f093ac5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Double.cs index 96456d284434c2..58b4d58c96a2a1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int16.cs index 9b239c81b56911..5cbf072ec61f7a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int32.cs index 26968c666b1aa5..a436d1cae29050 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int64.cs index 2e1fc4f9a5696f..cc4121005cad22 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.SByte.cs index 9bea81c6289cf2..44e59e292d32cd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Single.cs index a6b47cb988c93e..78e41c042aff55 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt16.cs index 63ece0ce9cea5f..5e291ddea8b181 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt32.cs index 96eeb23a1f7532..651e8955802dd4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt64.cs index 0bca1655946d10..30cb0565859c25 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Byte.cs index 7b85c9a93d1927..7fedef91550013 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Double.cs index 792d48e87014e8..95a2a47352ad5f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int16.cs index 5b457c86b87f9d..74ed11792cc684 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int32.cs index 53ea73a37bea15..88b7bcd69c57fe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int64.cs index 3fbc0df9983ab7..3e53cc554f1d07 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.SByte.cs index 6a5bc62b321d96..e8c4faf4063ad0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Single.cs index 1594a9c2f6ac4f..33babfea80a4b3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt16.cs index 68df3fca50f206..837114078130cc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt32.cs index 755fb0e365b598..9bbc83af89bbbb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt64.cs index 0a77706e24cae0..3ca9e19aeebfef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Byte.cs index c4e3794f550edf..f863bd4c0476d8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Double.cs index a48e056092a285..52242c91425982 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int16.cs index 583b27b22aabf2..540b5ea23c82a0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int32.cs index f5c9c1cb60dd45..b8f4ac33ff2257 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int64.cs index 6dd578a9e030e2..252a1e59856bbe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.SByte.cs index 445d30407bb320..e5a124ddde1fdb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Single.cs index 36050d973cb233..ddecdc738e3a4e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt16.cs index 5219f2f28da810..8b13ab9e682c23 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt32.cs index 5c446034e345cd..30ec242c39f00a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt64.cs index d3de409e6163d8..65ca43388f2717 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Byte.cs index 9aabc2665b684a..c6b556cadc168b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Double.cs index 973e006a2da043..71ae12f2d39a1a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int16.cs index 23c0d54d5c87a0..1be6e3665e4ff4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int32.cs index 3a070a071eacd9..63e3e659a12da9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int64.cs index 5fe8b862f88ba5..f3ce682cf273e6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.SByte.cs index cf72f0846dc331..c47a5ac38079f6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Single.cs index a6ffca6b3e6239..429e7bade15afe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt16.cs index 8c0d07958a95f4..33d4f13d82c807 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt32.cs index a02012ceb89762..cd25231e88cd53 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt64.cs index 906608d24b34c3..a252291b9c6430 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Byte.cs index c84ec223921800..6818833570bd1c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Double.cs index 4191d69f96a23e..c424610011f41f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int16.cs index 9fabcfd66019da..bfae712c665e0c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int32.cs index b9139a5198b262..c26cc7312ed32d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int64.cs index 430ab83c3d072c..6916ef94a8aed6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.SByte.cs index 1cc965eb413508..86341f8db8f93a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Single.cs index 69dc57861a41d9..7160aa2c6b800a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt16.cs index 2d111b9dbdd5bd..79eb51feb941d9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt32.cs index 61a56f6d1e3a53..175c5a0aec0ec4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt64.cs index 507c691b020b7e..4e038662b6e5da 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Byte.cs index 5b4585b850af36..8fe5169a4ecedb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Double.cs index 32bac9b13a8f8e..7325d475645f8c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int16.cs index fa2ac64cb64002..8cdcc210bde7ea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int32.cs index aa305771ca3e92..21954f83671b06 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int64.cs index d077efbbd7e84d..9bda565ce4d018 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.SByte.cs index 7ada5957b89865..ed05ab904414e1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Single.cs index 013919f58716f7..082e5d3179df7a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt16.cs index e0527277fb52bf..54fe52b63ca933 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt32.cs index 2ec153cba7d901..b5f2023379c8a3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt64.cs index 33b190bd5836d0..08704453d342a7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Byte.cs index 6f6048cfc5110c..59088a81255270 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Double.cs index 304f294f8f9e23..52d289f06cdcb9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int16.cs index 4f733a39a359f3..7566eb2017051c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int32.cs index aa092e4f470f57..16ec46bd3983d3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int64.cs index 9534fc747811f2..070808aabe4b8a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.SByte.cs index 3a68fa3e7147f4..e3fc6efd3fb2de 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Single.cs index 98e812cb1f3f75..44df205439dfd2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt16.cs index 58c7505e3ae3ed..21ef7141721dc4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt32.cs index 113f57a3b00e50..3d21b33af1a263 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt64.cs index 70331b0565935e..ace903676a0e02 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Byte.cs index 3bd231118ebf2e..68bd20993b1629 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Double.cs index 8e4df3ce537f12..93a51714bc2907 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int16.cs index 57fdad1a4cb491..97755c3bb2ba5a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int32.cs index 3091594a98dbe8..05c36d016cce21 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int64.cs index 04f95e17990700..7d877850fbac0b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.SByte.cs index be3bdd63da2295..6b12825413a484 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Single.cs index 75c7721d104714..529d10589f6249 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt16.cs index e282cbc615c377..cadd411c5f5820 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt32.cs index 7cbd2f0cffc136..3fa31e9a899110 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt64.cs index 4075261ce2a65d..fd8cbaca04c023 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Byte.cs index 2b641fb23c8eb2..16b7542a253f13 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Double.cs index 10b298a0f30dfc..d290aba66d7bf0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int16.cs index 28ff24affa8eef..94e33f79bcfddd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int32.cs index bfbb4697fa71c7..f9a286d334068a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int64.cs index d411a1c28c8262..722d463f323704 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.SByte.cs index a83285473098a0..2b7aa64c46d5a9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Single.cs index b812f863053672..12320381e1007f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt16.cs index 78b911bce68ef5..295033ab714896 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt32.cs index 715deb7287b4de..7aa3c7a6568d99 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt64.cs index 57268ae8950309..1f3e66e03c81de 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Byte.cs index 6e176d5724675a..f38db4e2f8bc4e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Double.cs index eb19e94ab75aa9..b7d1a03b578a9c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int16.cs index 7e9252d83ff431..cac37b488a2427 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int32.cs index c692ae723a0f59..7425a9b362e92b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int64.cs index 52cc435853f96c..2107c8dcb09280 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.SByte.cs index 77160c3bd4787b..6b5fb815c76fd3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Single.cs index c158f6fc9c272f..fb4924f9e076b9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt16.cs index 97728f07ca42e3..66f8a60250c8d5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt32.cs index 6bd89d470dc605..7ccdf40c3442fb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt64.cs index ac587ff9d95ca0..ef883c39fd4915 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Byte.cs index 798e6c1fba4907..93e0d8323fb9b8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Double.cs index 01976cbb040880..cb67ff99d20d00 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int16.cs index f59b2e82f558c6..33997cfec30791 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int32.cs index 48712c1658bc10..6d4a6e218488e2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int64.cs index 69aa05b128ce09..91d6a069108077 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.SByte.cs index 3ec930751359fa..b8fefd66a9da34 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Single.cs index db508a8a1e0f0d..39af8b21dc9099 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt16.cs index 3d9e4e22892793..7a124f3e3d2e45 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt32.cs index ab420ddb9fcf3f..b1704a9bdb7cc6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt64.cs index 84a20bb45e8676..1778cf6c10b9b0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Double.cs index c24e98423cd34f..346726e6574573 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Single.cs index 12f42a3da3d59c..4ba1eb7d7e39ef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Byte.cs index 68b072c8224859..24a6c6b40ba61b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Byte.cs @@ -76,7 +76,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] inArray3, Byte[] outAr int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Double.cs index b1dc65e26948c8..d4f9bd7460cd85 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Double.cs @@ -76,7 +76,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] inArray3, Double int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int16.cs index 289a6384e20532..92ff677716f810 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int16.cs @@ -76,7 +76,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int32.cs index ccfbe77b40032d..3ddd8cd11a04f7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int32.cs @@ -76,7 +76,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int64.cs index e0bc1b0b43fcc1..7b9b2ed64b2df3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int64.cs @@ -76,7 +76,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] inArray3, Int64[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.SByte.cs index 94082526409f7e..c9080c3ec8a94a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.SByte.cs @@ -76,7 +76,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] inArray3, SByte[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Single.cs index 38a0b3549edbea..9754e3070222c1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Single.cs @@ -76,7 +76,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt16.cs index 0f93ac17a41332..2e061dc91881a5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt16.cs @@ -76,7 +76,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] inArray3, UInt16 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt32.cs index 466447c2814d89..31b5d20e9b8f84 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt32.cs @@ -76,7 +76,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] inArray3, UInt32 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt64.cs index 24e29310a7ed94..01648a6d57c5d0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt64.cs @@ -76,7 +76,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] inArray3, UInt64 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.Int64.cs index fa1aca4d1a4e9a..1a3f89b9ff22d4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.UInt64.cs index 1643320662228f..440a82aeca0e26 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt32.Single.cs index 90bdc193cbfd85..f3db85983518d4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt64.Double.cs index 0df58f23e83d05..d3bcab2add0312 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.Int32.cs index a68d39e63f8775..a37fca6560261e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.UInt32.cs index 52abe0e6392289..90a02f8e7cd043 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt32.Single.cs index 5e8db4b5a576ea..1eb80eb7c964dc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt64.Double.cs index 3717465880481e..58475bf75349e5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Byte.cs index 958de9cb1a9b02..b4d2dd0a9ef342 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Double.cs index 8be4651e75a7aa..2bd32510e368c8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int16.cs index ceb0d0a57f2364..206c85838b976f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int32.cs index 901b5a4875551c..38f155ca4a9132 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int64.cs index a02c33b317578b..b13b2d9b29ade9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.SByte.cs index 908849f5f5cfb2..da3d2cb419ff9a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Single.cs index f45f7fe3119956..6d52638ec86e97 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt16.cs index d88c20170d8740..7671bd45bcfd27 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt32.cs index a46b97ef51e4ae..5b0bc77ab26864 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt64.cs index dcf4c518be91be..e53513ed46adff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs index d4e57461c765cc..6df5f319399bc1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs index e6eb7a4c473aba..a31b46968163e8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs index 226cffc5d4d817..0c3d493127c8d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs index 0add06a6628061..34a241f404e681 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs index 91faf9fe2b431e..237d3cbf08ba49 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs index bc4db8729d73f3..7fcc9e2df39cd5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs index 6b549c036f71cd..045f3c08f24463 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs index 8779fca1d0b8c2..777fc0ce0f486f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs index 09a769c9916c01..9363faea093190 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs index 26f8806b0b575b..b01e24d8b3d7a4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Byte.cs index 8146aac8fe5145..a3a1ce894a32f9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Double.cs index 342000263295ed..924ad8e31001e8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int16.cs index 38b9f65e07c1b1..4b7e8d6c61c140 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int32.cs index c34a148e458401..a44bdd24431736 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int64.cs index 91379253e748d4..924d6d6fa79ff7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.SByte.cs index ffd19057c3f0bf..d3dd7eb4fa5bcd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Single.cs index 3a10728513638a..2d30b524cabd76 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt16.cs index 8f28fa0fee704e..4cc76a00b41502 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt32.cs index 81d759e8cf3c73..6c86253767d39f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt64.cs index 1137e47680e426..75cc06ebcfe43d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Byte.cs index 1ea6cdcdeb9a9b..61a983d2c4fd7a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Double.cs index e3dc529ed759e7..0686df81e35cf6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int16.cs index 2f610115ce9af9..b7317e3431ce0b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int32.cs index ed14aa0007c8fe..6d0b4fe6077141 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int64.cs index c23c4197da73b8..647f15a568b7e2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.SByte.cs index 7ce5d221be58a2..753c6befebf28b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Single.cs index becbe63312a047..9c39ad513a028f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt16.cs index 26f9c5de1837ec..8fc493b257ea94 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt32.cs index bce67fd3508451..5610196f75c76a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt64.cs index 409dc3e300bfad..8215ef1c1cbf71 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Byte.cs index c43334bd68456d..b09fd63d57831c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Double.cs index b193396a71e52d..f05aade14b624c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int16.cs index 81aa451cd66e95..678d7bff0ffb90 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int32.cs index aa3fe9f788b00c..6a9dce995cecab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int64.cs index 429a5951137122..5c78645a75fc8d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.SByte.cs index 3d0146af14469b..f451ba243bfaf5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Single.cs index da46cb195e1701..ca65656c534b4b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt16.cs index 3d8d83f10d5330..72682e2ac2709d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt32.cs index ebc149e18b8ef8..feaebe2991123f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt64.cs index 6aedf31f0de887..0cf237500cd434 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Double.cs index e6a8f0285a481c..7708df47ebb4fb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Single.cs index f611a9b1af7f09..e1a06ee2bf7641 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Byte.cs index d667e1e039c661..05a3d4ab381f04 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Double.cs index db0647bb266616..3dc6aefb8d0eb7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int16.cs index 315a41c1957fc8..b6639951b5e922 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int32.cs index 47d5de0f93ff26..bb69465fa35f45 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int64.cs index 0b9886af4e7a5b..14999fa436d0d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.SByte.cs index 79a3261d939668..be6597f965e9b5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Single.cs index 8a9b208af69eed..1f949e1b3628d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt16.cs index e93cf2a4f6da40..a7c6998cef0e9b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt32.cs index 58894a57ed5fde..bf1dec013bbab6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt64.cs index a5643a2ac88d18..a6b4be04eb6e56 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Byte.cs index 9af58b9dcc5e61..883ec42a05bc6d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Double.cs index 3b4c3012dc0d40..b0b68148ad0f66 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int16.cs index d511dc208275b4..9ae7b2c7432cff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int32.cs index 9b99a2a450256f..758274c4559a39 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int64.cs index f497c437276410..ad0765a1c9770d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.SByte.cs index 86066da95e574e..3ad126f0d543d9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Single.cs index b91838218e001c..25a7278ba82f3c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt16.cs index 00bdc5e60048c7..1c11ec2fc2b767 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt32.cs index b1a92419d062df..f263c7ce53d3cd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt64.cs index 713a175070d876..90cf5ac739f629 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Byte.cs index 6cc131927cfbe3..02782c905518b3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Double.cs index a2f41a177adf24..8cf519e714e6ef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int16.cs index ff4f20137ea0fd..df2f314d29c131 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int32.cs index 39b64044f21836..14a518c671f6b6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int64.cs index 5b467395ceb672..81be95ef318aa2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.SByte.cs index baca1af9585646..f66f66ea4c9740 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Single.cs index 9652714a6f0a45..c8951f060cb2ca 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt16.cs index 3958185b974fb5..1b393d6a5c24c1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt32.cs index 46b7a402a44b43..1256dae96b1d6b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt64.cs index f7374e5487181a..7eb00f8a18ee1e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Byte.cs index ce1ae37d28a911..142a4102b33111 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Double.cs index 970dbb32592ef4..73ad65f4943b21 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int16.cs index 4119f755f02ee3..8bbae9593a8f71 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int32.cs index 6cfdcc4cced765..67f24960e3b906 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int64.cs index 91b2c3df970c25..e4d2df5693b841 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.SByte.cs index be489f228db1b2..7dc842232cdc64 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Single.cs index 8e400d153ca1f2..7ce2ec59ac65b9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt16.cs index d02d88ae94434e..11a73f9046b1c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt32.cs index ff6e04abcc981e..b581a229b65544 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt64.cs index 62ef62117112cf..d8c864d8741ea5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Byte.cs index b0662902e675e3..c129a15b3ab681 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Double.cs index 7d29923a1c4890..7a9f2098573d1e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int16.cs index d430b3b1143af0..674a02de021cc1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int32.cs index b1d5a6fb4d56cc..a6d2f9b9a06306 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int64.cs index 0c6c3d319088d2..48606bc998e798 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.SByte.cs index e8658ada9bf7b8..956c6e5669074d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Single.cs index 051223c43fbe20..5495b9447a815f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt16.cs index 50fbafca782baf..e7ff0d596addea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt32.cs index 2e70484fc8ceca..dd43975b89be11 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt64.cs index 4ef72a25c9149a..c6d74738d92c2c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Byte.cs index 7bab13a38520a7..d07081ee818e93 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Double.cs index 8ee8d327a1e889..aad2e4ff18b64c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int16.cs index a6b599df9cb801..cd1893a7d736dd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int32.cs index a74d27ebff2f93..2a22c8617e149b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int64.cs index 49656926e7440a..9bd6f476ec3ed2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.SByte.cs index 0ab44e657e2fc7..aa5a584ad94177 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Single.cs index 3129978c595421..1c87deda320eb8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt16.cs index c25fe5fc38b710..90e9d6025aba1f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt32.cs index 904f87f2866a0f..00b4032dff3736 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt64.cs index 9d778384fd946c..894a019ee84de7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Byte.cs index b759c0cbedb783..2c05edda982679 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Double.cs index 4b2ab494c9617b..5ab9b7019cda06 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int16.cs index a68933793822ef..55df6d12474bbf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int32.cs index 2d361b82ba61b0..0c2a08efd5103b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int64.cs index 0f979382573a74..2750110a4f5750 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.SByte.cs index 6eaac1d2fb621a..10e9b7fa863a16 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Single.cs index 01c1a4484116d3..9bcd961fc470d3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt16.cs index 4287a657973e41..1e3c6a7cb8e9d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt32.cs index 51bbabe070fbc7..4396466509e147 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt64.cs index 45d533c7d8c81c..acbea1d3c09bea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Byte.cs index 257b0a466f3b2d..e5002eef6a9677 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Double.cs index b9bd57acd304a4..156ce31595a331 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int16.cs index 353805133bc7d2..b68ab448ac22fd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int32.cs index c6bbf163e53e1b..1e0a73d8961f77 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int64.cs index 514f9c9761d033..f96b49696810ba 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.SByte.cs index 7197e556332c85..3b2e360955cb32 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Single.cs index 1d529b2d1e1c34..ed698a3a30a5cf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt16.cs index b275ee00b79679..262077b1bc7e7b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt32.cs index 1e9308ed0c0017..c746cfe223a109 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt64.cs index 3e5725d594b951..49d02c5343f73b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Byte.cs index 8bad0954f81e96..b1e32541d14145 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Double.cs index d3e7bca443f945..1beebdd181cb6a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int16.cs index b5187f8eb16482..20a2ff0e304ca5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int32.cs index 484b1713e1f7d8..54760ac8428c65 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int64.cs index 03406fd0017ea7..cac0d6d9b29db8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.SByte.cs index eb775e857adc7b..11dddfbc7094d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Single.cs index 61710c9d8ee851..43a3cf4b070498 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt16.cs index 26ce835fb8bce8..5e11badfc11500 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt32.cs index 64d0620b7114c5..7a1d20eca54e76 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt64.cs index 8001dbed00d1cb..6824ee285d88d1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Byte.cs index 91335b4c4e375b..da9e348550c1d1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Double.cs index 52fc4730018cb0..aa5de18291169f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int16.cs index 1b91acac68ff83..203c60a3f0fdad 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int32.cs index 7b84b2c925dd06..333ce1c104b1af 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int64.cs index 7a1cc66bd0aa24..a2da0d434667e9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.SByte.cs index 5203ba8a0e9caa..28c2fe534e1c8f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Single.cs index b4d5d78a38f3aa..2e5941c8c9eca8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt16.cs index b699ef08e561e6..67a80b54da32ed 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt32.cs index bdb95b9ab3618a..d44601ab4293a2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt64.cs index 44c1d11cd1bf17..ebba9c5ded1545 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Byte.cs index 1a5cb5c479f236..a680c30e760d1d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Double.cs index 97936e9dbf51b5..56d6917ba9b3f2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int16.cs index 31d4dbab971add..e688bcb3ec33a1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int32.cs index 5c2de82d5759a4..eb6e13a5575f58 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int64.cs index 10161d6aa5db2d..37dd238d04c9dd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.SByte.cs index e42c5648a1aff1..3fd706d8d53fdd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Single.cs index 26d40bb85793b7..5393c7d2f49269 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt16.cs index 74ebb9b8772037..fb606d05a5487b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt32.cs index ee7adc2c4b1cdf..3f1f9bd397255d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt64.cs index 4dbd1ee4164a99..8d2aa99d5511a9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Byte.cs index 54a57814a1ddad..e301098af409d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Double.cs index 8922428ee1aee7..ac8db446b2aacc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int16.cs index 6c9dd8e9b64b7b..17dd051ccba844 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int32.cs index c6802d17f9a81e..5a3aeac2db3deb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int64.cs index 06003efa776324..2ef4c136749858 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.SByte.cs index c7134ed3ce2ce5..65cfb425b67b56 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Single.cs index 38f9d7bf1c6046..e22616dc026144 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt16.cs index c724a83cb410f8..5baa7c6865e794 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt32.cs index 281f47f410f3c0..d4f033cf3df71b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt64.cs index d895ea75bfaba0..5938d0992a6468 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Byte.cs index f947b02567c777..ea82fa9a6850bb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Double.cs index 601df2c2b56037..16b7e3009fbb41 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int16.cs index aa4556bdc66469..76e9a2b38d1e02 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int32.cs index e3935027b39b99..0dc66d2fc3b5af 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int64.cs index 4598cd63434197..de67ddd22874e6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.SByte.cs index d753d20f985afc..80582b6c8c402d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Single.cs index cc70945f9d5f21..edf37655b551f2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt16.cs index 46f1ca8c7f7e33..85501635df32bc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt32.cs index 88adb4c8042da3..466e702348694b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt64.cs index cf38d3a6875703..34002b91a41023 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Byte.cs index f7c3c71329212f..ce011a8ffbc350 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Double.cs index 00275551015249..469959ed797cea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int16.cs index 5d102c248d818b..086774a6022ef9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int32.cs index d664030fbbe8f7..5b6655b9f7e571 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int64.cs index f38117202a4bd4..b8e2e59f80af69 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.SByte.cs index 34128fd5f080a2..12dd6d8ba53fbd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Single.cs index 4d030e94d640df..58e46d190d9688 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt16.cs index 621bfd1fa29934..4e4abc54902b67 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt32.cs index 28ed4580c8b7ca..3920c0127f7c99 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt64.cs index 5e65903e17bccc..33c214562ca8e8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Byte.cs index 58006e730c0518..bcb949431bbabe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Double.cs index 85bdf0642e4524..871393b1d4a698 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int16.cs index 6a458b377d02e0..b7c817486ab880 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int32.cs index 3e2064fe394444..0e1faebc79dac2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int64.cs index 295485858a178c..c17208bc2464f6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.SByte.cs index d7e1810f39e951..71477230b572cc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Single.cs index 49cde23ebdd3b1..1a61ce2fd36280 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt16.cs index ba384f8371c108..73c022efec3df0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt32.cs index def177c017b31a..d49718428bc0cb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt64.cs index 4abfdc523b01b3..fa058b65bdf7f6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Double.cs index 3d7278c5b45a5d..897eece4c60078 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int16.cs index b594604232ba34..4a959f6f1b2a09 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int32.cs index a07f5333049f8c..63dceb56dc179e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int64.cs index fdadee89100124..26f2328367f5c5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt16.cs index 16e69d10503326..b12bb2f28dccd1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, Byte[] outArray, int alig int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt32.cs index c75b0842072000..4cb3ab9b936fe4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt64.cs index 99a2535e05aa77..7a6e2bcae32b05 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Byte.cs index 55c89e6552512f..ff660a263e10f3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Double.cs index 5cecc6c429ebd6..14402a47e82bd5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int16.cs index b47750929c53e9..ac13b667aae5bb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int32.cs index a3b9b5f355fe1b..9d243b7ec9abf6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int64.cs index a027a005193048..0f9be7e7e129a3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.SByte.cs index 76ab7560aeae76..99d9ee01b375a3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Single.cs index b2bcbd1b1d6bcf..1451980891848b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt16.cs index 59bb436d689ddf..c57dd76a6e3520 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt32.cs index ea9f13334bbefd..e1ed17da6690e3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt64.cs index 3a01b0ea6b7d28..27f895f559510e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Byte.cs index 384ecdda55c1d8..db267f30b32e93 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Double.cs index 4e33280707b929..3d055ecc384938 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int16.cs index f5922ca8c486a0..96483ff27e92ea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int32.cs index d4126af8c1f71e..ce10c11f6f31dc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int64.cs index a493e13028c8c3..3f9be85bc1577a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.SByte.cs index cf85d7edc4cecd..62424ca9fd9e8b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Single.cs index bf50eacb76144c..985be58c1655ef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt16.cs index 0882af9dff110d..b3137940594feb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt32.cs index a334d594ccb37b..97e5fb543410e5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt64.cs index c1b9080d09abf1..0019d7ad6c1398 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Byte.cs index 8339dfdbaaefe2..eceaffd586cd3c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Double.cs index eed3638925dcbb..b49b88b790c574 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int16.cs index 3965f7020ab76a..265256355cf8e4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int32.cs index 83ee6516930bd1..370c7b9208878b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int64.cs index b34710af46350a..57e4739a15c0fd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.SByte.cs index ac8962bf633671..0672f5cdf52511 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Single.cs index afea13df6ec2cf..99c5d52fc6088c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt16.cs index efdd08f19ff87f..30623ee9ae6c82 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt32.cs index f8785661a33cd3..4fb0b7f5bb78f7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt64.cs index 4b6ebac6dae0c4..c098760a8daeeb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Byte.cs index 3cd5d6a69c81df..3943e8850413a8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Double.cs index 9491fd7a6a72a8..ad0e9bec500d7c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int16.cs index 9505eaa4d5551f..08fe30a7cda413 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int32.cs index e89aa568e0e658..ed817a53c23c26 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int64.cs index 83186ea4d023ab..948113f8af640b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.SByte.cs index 89552dcba1ac60..bd6240338fa875 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Single.cs index 8a2f615d3c4213..61767423d3ad6e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt16.cs index a25317f483efaa..74654926db77a7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt32.cs index 87e843f19616a2..51564986fa721e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt64.cs index f1aa5ac742c284..595ef7c3683881 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Double.cs index 63b223cde86f72..bd3af6f98e8213 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Double.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Double[] outLowerArray, Double[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int16.cs index b27b30d3fdbd4a..57b638e50acd3a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int16.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, Int16[] outLowerArray, Int16[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int32.cs index a9bfcfbdf8743e..30408c1a2b7cb7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int32[] outLowerArray, Int32[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int64.cs index a55cd0747f92dd..ce71edcead5bbe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int64[] outLowerArray, Int64[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt16.cs index dd068944edac35..e06e628e325502 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, UInt16[] outLowerArray, UInt16[] outUpperArray int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt32.cs index fe69e46345a891..9a06f3f06f358b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt32[] outLowerArray, UInt32[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt64.cs index a5f812f006127a..b5c3c023b92dea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt64[] outLowerArray, UInt64[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Byte.cs index e973e3508f7923..e82be743803900 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Double.cs index 0229ab16a8d0d0..0bcdd8f3daab9f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int16.cs index 8a940aa849d235..1e442bc52801f5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int32.cs index c16e4c9481c3ab..626d36e40d7a0f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int64.cs index a4f2a76f610504..87a1061e29dff5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.SByte.cs index db55fbebcd30e6..08e0534a7d42b9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Single.cs index 62806f01f5ccac..9af532c37747b1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt16.cs index 2fc481dcc2de57..8fcc1e6dcf0402 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt32.cs index 1d798b56db25ee..fbed449d715860 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt64.cs index 424ede42842e8f..24eed6dd3f041b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Byte.cs index d85f2a23336dca..edb1bd145e2744 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Double.cs index 58babd78b036f9..f5b228794fdc7f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int16.cs index b7518f10fc584f..884be13c44bcde 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int32.cs index aad03698604b3d..2902af5dd77023 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int64.cs index 784d2e4e4e9bb3..062d0ad548c10b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.SByte.cs index 2110c6edc4f0f9..f959ec23b5a5b8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Single.cs index 9dc4ca3ef7bbbc..ea71781710cbd7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt16.cs index 91c626ab02bad5..66877780897fe2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt32.cs index 2dfc9ea01b2083..5b90c1e99228e1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt64.cs index 60827b04149037..60d83da100949e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Byte.cs index feb533caa3d709..9123dd4ddef7bc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Double.cs index b2290ce43813ae..7d172db1f77a44 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int16.cs index 4eed2d8f88b27d..98c595e95d78c1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int32.cs index 52c1bf0c1cb3a5..cb7eadba54ae17 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int64.cs index a2273a8ba5752c..68763d5d710ef0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.SByte.cs index c6abafc13af1ed..a3b16fe5b23434 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Single.cs index 3ae7bd45276387..72987f8d43666c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt16.cs index 05369ef0263cef..5a80c970149d83 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt32.cs index 41ea1428323aa7..47045dcc4da642 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt64.cs index da74ec45714f19..cfd8947eae9cf1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Byte.cs index 72f28f17b2d734..72b8e9634d1bf9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Double.cs index 430e6e0a9a52ff..5005079e705365 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int16.cs index ea38671d33a462..644a5b2fe5f72c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int32.cs index bdfe85606ada35..a946ea638aa8d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int64.cs index 3d2133bae3a4b6..f86bb2a2ad3cd0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.SByte.cs index f4349f9c16877e..de2d91d29c0d10 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Single.cs index 0498478708530e..39d0b2d7bba416 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt16.cs index ef4bde2dffd32a..7fb2d0a2eab3e8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt32.cs index 7cdec16a5cdca6..dd7b66c8bbcd08 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt64.cs index ef27c1681a4fc7..8be92dfc997af9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Byte.cs index fa9a58adcd8bd6..fc4e5d8c4c7fc7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Double.cs index 79715b2aeaeb85..69ad39457c6689 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int16.cs index d284141acafa11..eebdbefb145809 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int32.cs index 7a6d62030bf8a6..c6aa084b9429ed 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int64.cs index e3fba5f8245e7b..78a2b9b8e000ad 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.SByte.cs index 75a70d0ad834e4..e0f1a74de275f3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Single.cs index 74649833576b3e..e2f95534b776ac 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt16.cs index 7de77256862338..8b0dfa8c69fe80 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt32.cs index 0ed53d6bae75f4..bdc853ad0d7d66 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt64.cs index d57b6719b14980..6e99e2f4ae3b52 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Byte.cs index 3c8a0aeaf074fe..fb0a1b9650488e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Double.cs index e8f9dc677d2770..4e5a72ee5e18e4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int16.cs index 97011343a5c413..8ceeac47680147 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int32.cs index 225e8514b3f1af..8c9b5a7d57d7bc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int64.cs index fd50f1396c7b8a..af2f5f7288e6ff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.SByte.cs index 390499451cc043..dcec37c20bc094 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Single.cs index 43df6badb6c655..fce65a0e4d3834 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt16.cs index 2cba3275321884..4fd9eeb8d03964 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt32.cs index 27f04f93199b82..c13c1b87a0364c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt64.cs index 28d8676c7bb3f9..e88699587cc9d3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Byte.cs index 286c59151be92f..5628bd5608384b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Double.cs index 8d17b7a183200d..1a2ee590e8781c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int16.cs index d80d8dd4e8820a..0db5f33afe9f89 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int32.cs index fbaa8774d38c85..f6d167cc68d36f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int64.cs index 6bdadee5c8088d..025e314b40b588 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.SByte.cs index 29a63ce514c0da..39305e86a11039 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Single.cs index 99865f4c7b24a4..9b0cc58cc79ff2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt16.cs index 9764ad9c730252..bee3a9eb4717a7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt32.cs index ccbd9ce25f3e5f..2a1ab8c13fa95a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt64.cs index e3cdb6097fc241..79f47a8b143bcf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Byte.cs index 6185d29de1baed..31702e5b290a35 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Double.cs index 81966f3bc3bb9e..fb7ad7442d1974 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int16.cs index fd71dee5bd6ed3..f4067c62922178 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int32.cs index 588cc1586cf418..f66c44b979e899 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int64.cs index b4b41859291b57..94dd5711b4d3b7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.SByte.cs index b18063f9e47a54..efef90b2a7eb36 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Single.cs index 9197c6db8e9c28..3c03668833f8b3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt16.cs index 8769a40cf330d0..9b800133a694dd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt32.cs index 0ad42a67c0228a..398218f2083b6b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt64.cs index 701c0a568730da..81a4da0ef539f6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Byte.cs index dca0dd1f805c52..1fa988d86d07b0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Double.cs index 487df0ed678911..db90892ccc2f7a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int16.cs index 3b2142cee6e735..b0ea2bb00dc535 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int32.cs index 40f65ae3be1640..b976dc7d66eace 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int64.cs index 0374ab70be075b..ae7070660469d3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.SByte.cs index 520a30bf4f7e36..221c1a5aab62b8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Single.cs index 93b8558869a29c..134d7bf46f2c3b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt16.cs index 419bcdc742d0a6..505a09ae7d8aa8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt32.cs index a6eb3aa4ab526c..4adcbc859506e5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt64.cs index 7c9d4b1a1e0dd9..2abf0f52f48373 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Byte.cs index 303d2e6ca66031..22518139230028 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Double.cs index 7bf3d7c17b8f5d..badc5e7812f7af 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int16.cs index 379d8e56e35492..e95053369c211f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int32.cs index 9b4dd1b5549155..c3d526b96e6ad9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int64.cs index 24bcf2c7e6e8f1..7239141cb4c194 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.SByte.cs index 09b5ccf7dac51e..d4d9c472239b0b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Single.cs index 679c1a6aaffe62..68d046a568e768 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt16.cs index 8a625f9b185ff7..3a6331a12988d8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt32.cs index 41652f72a0cd0c..9ea80e08a99fb1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt64.cs index 96d1d0f5a91f12..7079c2fcb3c328 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Byte.cs index b0a0fb3e7899a8..b7cec03a716a4a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Double.cs index 33ab56a5c12845..0cab1a1dbc103e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int16.cs index b241a50853e2c3..f7ca83717a2d4b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int32.cs index 588d9a4356e4d1..065b63665753d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int64.cs index 21cebc6eaa40be..35f4c57d64a030 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.SByte.cs index 671f3f48750d49..7baf14bbb5baed 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Single.cs index ca923145944db1..a43bea91dc05b2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt16.cs index 2fcbf14c1d0292..6b1abc29378e7e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt32.cs index ef9abfb5114a42..0725520232fcec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt64.cs index 5c29c5ae8e18ac..a9c9f0d8a1c184 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Byte.cs index afb2407a51ee7d..32ec7fae73456c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Double.cs index d3e33b604d7899..e9e93e36496ed1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int16.cs index 9d86354ec4937a..3218dc001f5101 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int32.cs index 1a22e94910dad0..b70d3ca755a873 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int64.cs index f5703dcc7c9ebc..8d4b3bb16b8f18 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.SByte.cs index 677beed3493aa8..4e63922fea3283 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Single.cs index 3de84f1c106a3a..0b512af36de379 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt16.cs index 233dfa96eae0fe..3e7ac0f6c91786 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt32.cs index 55ce949045be7d..bd4dd1c8f90f3f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt64.cs index 50618939268b1d..c07ea142d03c30 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Byte.cs index 14ddd64393bee0..62116a806747e6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Double.cs index 000d04c8f47101..00408af5f9dc23 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int16.cs index 568299a53abacd..c6355435e504f8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int32.cs index 62a7959f8d39d4..e892ed1f309def 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int64.cs index 154004dd83ddd3..336210b9147531 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.SByte.cs index 6e324c668efd52..11c63d7cfdb888 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Single.cs index 292737036d4276..204c9ecf2c8453 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt16.cs index b4adb69e29d123..5d3b8b280caec8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt32.cs index 335eefb99179f1..3d23e7a230d0d8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt64.cs index a84c71283b49db..7ced9dc59a6d09 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Byte.cs index 05f230544ffa55..53fd29ca7b3b33 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Double.cs index 97cb53e84688d1..28fecd34942121 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int16.cs index c3931987203fe0..2ef8607fb06137 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int32.cs index 92b27ff3b50ea3..fa3ab0fe1a1363 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int64.cs index 34241bea731ee7..1cb876cd0465ee 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.SByte.cs index 830233ca449655..2b540c69fc7232 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Single.cs index 8975f62db45675..892dfe6a496c79 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt16.cs index 979d4f22f9e448..aec4ee3822c491 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt32.cs index 45b017fc702bb1..14439fcf8d01f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt64.cs index 8fa01e60dd303f..69c4253588dffa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Byte.cs index 7f37bdbe8537c9..80f7ec1eb52b5a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Double.cs index 02bf624ca4ebdd..7909dc8d7fa8ab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int16.cs index a4ec5ba363d832..abce6d92af6341 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int32.cs index d791d701985ad4..ca28b59145599c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int64.cs index 870e1829ebe150..dbfbab7617592a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.SByte.cs index bbc7cfde4f8015..0b100227b8754c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Single.cs index 49460b1668776a..eb11f4e990f79e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt16.cs index 2a228017905873..7870243c81b61f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt32.cs index 7671b7471b0c72..5117ff5d0096a7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt64.cs index 4048b779b0f053..9754a66594014e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Byte.cs index 5d12a392a71411..696760c0e4c806 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Double.cs index 9b2624470ea9bb..d8b22af648f0d8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int16.cs index 7fa822f944f334..b2bff5efeaed15 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int32.cs index 699bfa69a5ee7c..f64c6c1c76b2c8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int64.cs index e97673df36bb18..bb79866b786b1d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.SByte.cs index 062cddd450e041..a90d6fac9189ae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Single.cs index a6a08326bd81ce..77e8889a4612ac 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt16.cs index b70db63f73b5c4..ce55bfe8344b7a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt32.cs index 838e80c454ed74..1aa9dd7f694327 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt64.cs index f2190b1978fda7..4601cea7da19f4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Byte.cs index a7bd35e5f70107..5fc4d0f4547104 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Double.cs index 677d5e444de581..07a9165940d21d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int16.cs index 66a394590d4597..dd9a8625e12c0e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int32.cs index febb3c8b1b4dbc..15c22e3db2c9ce 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int64.cs index 8ce669158c554d..0583547c4ec8ec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.SByte.cs index cc5d15876e52fb..c01be7411e7c40 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Single.cs index 85f531c7982076..3d8b29c5e17e16 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt16.cs index 7ea0a31f16398c..d92c07056d5473 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt32.cs index b435d89af9c44d..443636df24e3b1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt64.cs index 7ef3bd6a92b645..6bfa82d839e621 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Byte.cs index 227d3aaca27919..bc1b5114c24bcb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Double.cs index 647ab757914a31..7c8021763125f5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int16.cs index e8e4dad3624f85..f86521f49cb3ea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int32.cs index fb52e460ced277..12f6ea9522ca3d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int64.cs index 0c9184b106fc12..e9c6e6563b992d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.SByte.cs index 0fa9be06cbefe1..3a416ad2c07a7a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Single.cs index ecac79ce3ea391..508f09971cd1d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt16.cs index e2c5b81620c736..5194a549cc5c4f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt32.cs index 5cae6cf5cac123..5eed6842c8e26f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt64.cs index 52ab723c1c5d19..3421a919da6b28 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Double.cs index fb4efa275f0fcc..79d405997626ff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Single.cs index 4a9899ddaeed48..dcc7e9f17b7883 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Byte.cs index e09a1e6ab85063..453b41c0c81986 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Byte.cs @@ -76,7 +76,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] inArray3, Byte[] outAr int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Double.cs index 09c7a358f15d27..cbb8c4d9ea1c4e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Double.cs @@ -76,7 +76,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] inArray3, Double int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int16.cs index 4de3fb51773255..ab0c2203d0892b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int16.cs @@ -76,7 +76,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int32.cs index 2aaf1331037499..27baceb6de26e7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int32.cs @@ -76,7 +76,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int64.cs index cbc108a87b5229..cfb07bb5cd06f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int64.cs @@ -76,7 +76,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] inArray3, Int64[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.SByte.cs index ca832d8f136884..fe826c9b8a3aa0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.SByte.cs @@ -76,7 +76,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] inArray3, SByte[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Single.cs index 4ca83dae159053..b60f30f87191c4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Single.cs @@ -76,7 +76,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt16.cs index 89cebe785b6a4d..aab6fc6e7a4513 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt16.cs @@ -76,7 +76,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] inArray3, UInt16 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt32.cs index 8c64b3a6b4d6c6..168c659af2d1eb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt32.cs @@ -76,7 +76,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] inArray3, UInt32 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt64.cs index eccf95255def89..b008947be4a002 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt64.cs @@ -76,7 +76,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] inArray3, UInt64 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.Int64.cs index cddec86971ede4..58981d221b15fe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.UInt64.cs index 619dcc65eb6dc6..b4e43677b306c5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt32.Single.cs index 0ca88929d86c2d..3d884a291aa7f0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt64.Double.cs index d97d8290b7fe60..848635c9854938 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.Int32.cs index 7b4c64a2b68273..26c1649981d34c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.UInt32.cs index 86c60b45faf31f..c735c2001f5cc9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt32.Single.cs index aa471e04041a36..d74b02f65fe720 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt64.Double.cs index 15e0f179ef4601..52e88cf64c4564 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Byte.cs index 99e0fde1f9dc41..11f738abd2e257 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Double.cs index 3ab5eeda8a6fb2..303088eab4f7b9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int16.cs index aee5ba12074075..fabcaa1ddc7f01 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int32.cs index 1d98a32bf6745c..88899c3f777993 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int64.cs index 58fd1908678d2c..e5ceddc1586eab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.SByte.cs index 47ff02908c0197..ab21a2e38f622e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Single.cs index 6c267e8421e40a..fb8b9cf0e1fe72 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt16.cs index 8bb0d59ee89629..17d57c981321db 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt32.cs index 49ea387820d702..944d5dc5af7c93 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt64.cs index f6ee5a775a615d..c4252cb7dfe6c9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs index 780f2aca720e19..efb6d47461fe3f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs index 33fe6fe0831a74..0e2add0dfbd21d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs index 5cb8b452a399b2..00360c20a93318 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs index 200375b8179a6d..538d4153725d30 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs index 647ef036158613..8448990c6c22c5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs index 74375de6994334..e759c6558d5245 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs index 0dfb8e63a09450..b0dba78909a35d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs index b367966aa846c3..4301c4be3688f8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs index 46bdff5a29329e..757df362f21a96 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs index 7bc9f1c1162ea7..3f693bd3419fc2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Byte.cs index 84f38dd716bf10..0bb2e64b1004ad 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Double.cs index 28cfddbfaa3dfc..d195545b28b938 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int16.cs index e1be74348f2b64..cd4ea1bb5b939d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int32.cs index a519f1d6fafc97..11db21a5514c92 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int64.cs index 986e9340f25654..4bc7a0ccff7028 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.SByte.cs index 202ab1367dc64a..191cd061f4c7b3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Single.cs index 5d9b519bdb8782..10544d64409d67 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt16.cs index 09349aa5f4f3ee..fe3117e17e45d1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt32.cs index 88fcdb206f3541..56e0ccf23a23ee 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt64.cs index 3d3613c38e4d3b..95be9a2aece25e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Byte.cs index f1d251f3418851..31dd5b2152512a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Double.cs index 81272785952c6b..0318e77769f243 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int16.cs index a3343a20f46f31..69ce0314013281 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int32.cs index dc6332e73e8763..6cd8014fc972d5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int64.cs index 20990dfbc8c3fe..468ed4ab70e7ea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.SByte.cs index 85ed136d212af3..8cb00fb65308a4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Single.cs index 3d723beb7b0491..ac63d0246c8d60 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt16.cs index cd86ba34ceb664..61d120c5a912dd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt32.cs index a0bd2ccc4dcce8..175d5574d1d95c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt64.cs index 388b41626b80a6..86374f114a7c28 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Byte.cs index 2092ed4e96bb5d..fe18fe2de64f06 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Double.cs index a3279f51cf2ff9..21126ce8e55a8a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int16.cs index b96fa1d081f8d5..7656c9e2a32799 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int32.cs index 987405fb0a8a6a..f69ae3a24dbf17 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int64.cs index a474aafbbb480a..a32757602ee8f0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.SByte.cs index de3e1d1ad0d253..6f4674fb7e2aa9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Single.cs index 94b83fdb92cf4b..cd8e55e91763b3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt16.cs index ccf7dc4e92f449..7afca914fd733a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt32.cs index a4b9cf53478635..9c61a29d2dee7f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt64.cs index e55d62932f1538..243f130320482e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Double.cs index c2ff7b80008c39..a8538ac06dc7d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Single.cs index dfca9ee8ab9271..f546b0042c78d3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Byte.cs index 25f5b97f2b51d7..e07db0f411c914 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Double.cs index 3209e2e9129012..8bf75e468925f9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int16.cs index 7a307273a8cc80..a7e22e0254c02a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int32.cs index 982572e7f7722b..7ba404cfd34c0f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int64.cs index 80a5383b2e7316..e664e86f337a24 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.SByte.cs index a1dcb6e7f2b5db..47bd0810f50e0c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Single.cs index e0b41d7ecca271..710db523f955bf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt16.cs index e2f25006cccf2a..a18b748bce8c8a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt32.cs index 33ac896f6f940c..22c1145120cb59 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt64.cs index 3ee3f79f58438c..af4683c81e9db5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Byte.cs index 6ba4b1a30bfd26..a1f0cabeaaf154 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Double.cs index 08fca962581d19..160d3c9230dcd7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int16.cs index 0da4719f3c9da9..eef73dbb900d8b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int32.cs index cf8507148f6273..cf19328a0c9996 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int64.cs index e86ce9368c1bc4..42ce9069f03877 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.SByte.cs index 88d500e350c1fd..373b0950cb0a57 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Single.cs index 8ed0e476f59279..45d15d6e7ad9ee 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt16.cs index 745a76f4872080..17b8c9b19f3249 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt32.cs index e002036622b30d..21044bd2d5d179 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt64.cs index 8a50e79e13af29..6e127c3deb7153 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Byte.cs index 914c6dc8716b62..51092989c55bbb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Double.cs index dd29a3190f828a..cc02d6676710c5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int16.cs index fb01f74dc2657f..8803f95e65ad23 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int32.cs index 6d6d9e1a3a9899..5cdf69363f6aa4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int64.cs index e5e83746e7af60..db7e6eefd90e68 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.SByte.cs index bb3291ff46f5a9..3f611b89ac9580 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Single.cs index 281148d27e92e8..ef6d14bc583d57 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt16.cs index 77534abdb297f2..544958e2f033a5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt32.cs index 0249e722644b8d..703419989328a4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt64.cs index 76bcd96582864e..23f8583b4584da 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Byte.cs index 791134c106fb4b..7ab2993e2e8aef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Double.cs index d4c1b66b8338e8..8808e71dd3cc74 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int16.cs index c9bfbd02da1e87..bd67f9549e7686 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int32.cs index 20836fee8208ab..6bc5a5b4fb3eb2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int64.cs index 10c435db656e59..071888fcc4c941 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.SByte.cs index df25f5e63792f1..8f3bc97cb8bbf5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Single.cs index 2d1fc2290652cf..3359375b40909e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt16.cs index fa568855793091..de075f82a459b3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt32.cs index fac9d97e44e357..02626333b9e5f4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt64.cs index 5ee9a22cc5d052..ca7895384f0bc9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Byte.cs index 672c8c9f0832f5..6017d8a3c0255c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Double.cs index 6ed7f694397d99..1b9523949b2468 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int16.cs index 26cb33a5850b91..c0d85d599af2b5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int32.cs index eef3a46d3da10e..55dc759302c945 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int64.cs index 0e0b3367efd0de..95437bed07b083 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.SByte.cs index 5cdc190ab6e30e..80f43a5756329d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Single.cs index bd98aac64a5796..f96bdc0373c447 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt16.cs index b9f54773cd5e43..d409e51f4931d4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt32.cs index 0146997521d554..0a90fb6177e0c1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt64.cs index d4213c453de589..e2a27e6c99d44c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Byte.cs index 5328eb2f0f669a..aed5aba1dc4820 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Double.cs index 0877e7ce512144..ebf60bd8aee5c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int16.cs index 8d9945e64c477e..48f580bbd665a4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int32.cs index 931bfddd89b9f5..0ce3fa37190116 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int64.cs index 6480185f3f47b2..75360de4f6c1c1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.SByte.cs index 7738dd3f29a9f6..072fc75361bcb9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Single.cs index 50fe73957b4edd..e061230ef61aa1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt16.cs index 53b76e3de84eeb..a93bd5be549395 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt32.cs index 5485d568f7e163..8e1b7c99d62a2c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt64.cs index dc8df86d3b37db..3fe989a7d4f753 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Byte.cs index 1005fc0be5483f..330de230deb6f7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Double.cs index 228d2c5ec5a022..c73a9508c0f03e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int16.cs index b04506f683efa7..934bb9328e60e6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int32.cs index f6e666e9c87bee..6b9feae359e250 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int64.cs index 3e9992d0555cce..7f78349215d5b3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.SByte.cs index 82906e05158fab..e757ad43ff6a13 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Single.cs index 928a3eebccd95e..651482461eb9a9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt16.cs index d136318579e3ee..a437699b7626d6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt32.cs index 8eaff29e92cd71..015d7e8a4053a8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt64.cs index 0706fd701c26ad..aef7234a74ead6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Byte.cs index 7fb760ac7586a3..a758732224b8d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Double.cs index b294eb075ca5bb..462bae410c4aa5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int16.cs index b610f9f1c58446..92239a354439ef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int32.cs index 3664ddc81e1c1d..098bd3056b64a3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int64.cs index dd71e095a24368..e91879d6411758 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.SByte.cs index 4301e2c54fcfee..bb3c8115405f9f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Single.cs index 131d3f9fc7d013..8ef57871b96813 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt16.cs index 9f794fb7b5f1d6..33192ecb77bf77 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt32.cs index ed97ed16976e37..de60214488e14b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt64.cs index dc052f2d9f56dc..1cc719ad745b65 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Byte.cs index f6365a2cb39e6d..32936f041ce6aa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Double.cs index 1ce0e74127011f..667ed7fbc64e79 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int16.cs index fae3937e961762..2d7f438f9a46d1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int32.cs index 556cca19787d0a..3ad292b50e3c23 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int64.cs index e2c4e916f2faf1..f9267a1fb9b2eb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.SByte.cs index 2a3fbf6742f845..91be58e789b33c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Single.cs index 6006c1f1f21efd..6e2cf24c3ad5dd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt16.cs index 2dc55907b40184..ae3b3f3559f9a7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt32.cs index db2cc5c71b4761..bec918ef08d508 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt64.cs index 47af80b10ce00c..f4a038c77eadf6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Byte.cs index 602ed9a2cbaa5a..53fea3c83dc8dc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Double.cs index cd9a0e7cae6889..16c99b6f6ed364 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int16.cs index a3e8a412154cf1..cf9728567bd25f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int32.cs index 86331c7ec402f4..534065e5d81dc4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int64.cs index a3046dc132a0ba..55100ad80f0b3e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.SByte.cs index 9a13aad2eebca0..d553135b581518 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Single.cs index 255e0df0c6bd11..9959fa6fb49f9c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt16.cs index d3bd6b6ed04ea1..2391ac35f93b45 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt32.cs index 4c995b89f889f4..a4b2dd76350649 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt64.cs index 119d385606d687..6b3868b24409ba 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Byte.cs index b52b76f170d8fd..aa31ca62f6470a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Double.cs index 03667ed7e1a230..4464a632db8cf1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int16.cs index 8c84579fb58369..ec890b9d3e70a9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int32.cs index 60fd6a16cbb66a..6114397381684b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int64.cs index 554b3bcf746ddf..5a3ab210a069eb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.SByte.cs index a7fcf77c735320..7400dc30581b0c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Single.cs index 95e640cef60e14..5bcd21c7e1a54b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt16.cs index 626843a0facf86..5bf418c4ac60ec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt32.cs index fa2af2713923a7..6137cb0d557d20 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt64.cs index a273398769d259..7eef4edff8ecbf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Byte.cs index 8546e8b8fedc89..5a6db9db32957b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Double.cs index 1ffbc8a393b2cd..69d7435a9e3568 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int16.cs index 0288498c694223..e8a0fd4b0368d1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int32.cs index e11d35eaede1c2..7f8c219bcaddf6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int64.cs index 872c7cd18c268d..9e5fc00053df36 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.SByte.cs index 61326dd358b9c3..0393dab2767cf5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Single.cs index 8e170b21e3efde..eca111ef182b0e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt16.cs index ff7a113d0986a8..8543b27d22970d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt32.cs index a1bd034b50ce47..2b50d7d7ff4f06 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt64.cs index 56911f56293d18..3de2575d206b7b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Byte.cs index a3e8af4b157670..c6340d6d66cbdf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Double.cs index fbcd10c2927744..df2b280ce39aeb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int16.cs index 9b40d972574ebb..970a3c59d43fdb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int32.cs index d77b909058ad02..1fc8d4137807ea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int64.cs index 8acde7549e1621..20a5775b1bbb6d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.SByte.cs index 7fc4ef84b63fbe..4a6ef4e75d49a8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Single.cs index 420b54f8070a59..b1f73413fa32cb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt16.cs index 1d97c5046293cd..6f8914cf42940c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt32.cs index 8968945a47b2cd..57d8265f376eb1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt64.cs index 42717fc448d892..7b829660428f16 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Byte.cs index 6a0f121ac99861..544ee64951f433 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Double.cs index b805fa8c0200ad..fbc8cc96972221 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int16.cs index 60008074031886..1ec606c2509288 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int32.cs index c5b40d6f13bdb6..9fa08c467c7f28 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int64.cs index 635d8d0bc06128..08f9a2d7e37a66 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.SByte.cs index 207b18214d1370..b895add0891694 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Single.cs index 10a6e00ceb5475..2c296ec29aa614 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt16.cs index 4f238abc6b7154..b36404a3d085fe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt32.cs index 8665831712fd22..9f72471613e7e5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt64.cs index 31243c50e06883..50253239afe5f5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Byte.cs index 0abdf2fd757ce0..e1855e18afc579 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Double.cs index 6c92ecc2dfba90..b2e3c3f5d6a530 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int16.cs index b1b201d0bdbc4c..271db53696a235 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int32.cs index ae963b2cfcebf5..24edbb526b4821 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int64.cs index 3f80fb554e3d32..e1ad8fb903db61 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.SByte.cs index 9f64a0a6ff388d..9ed5b5b19d822b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Single.cs index 6b623a9dc22e0f..27b826719d063c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt16.cs index 9030ef586eb7c1..b3a1a59ef3ce72 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt32.cs index b7b9760998a60a..b8c598f3edd0db 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt64.cs index dddfd7bcb69a88..cf9f44e64ab61e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Double.cs index 7f06d8a3735ec3..994450ff6232e3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int16.cs index 27ab763b5dc6ee..1d0f7c8a05cbb1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int32.cs index 22ead69e740c2e..a0cff146f952c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int64.cs index 558fd169f8da13..67b5ee0bae1ea3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt16.cs index a302527ad944e3..4e33e467df85b7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, Byte[] outArray, int alig int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt32.cs index 4908d23cc76d1a..1d3d959b37b1eb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt64.cs index 9a890333f3d963..d985f269820fd3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Byte.cs index f6ad0f1d46e855..b0107f0a452079 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Double.cs index d3126936ee8265..b8bd348101d249 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int16.cs index 66bb6831c1ccf1..ab32c910915e63 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int32.cs index 6973c203b61249..def8173a3b158e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int64.cs index 0042d7015e1a4b..0e8eccd48ca718 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.SByte.cs index fe7c676b6e31a7..420c994f6678d9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Single.cs index 6ae1bffc41555f..d11b5fc0a3b70d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt16.cs index ee8f3e2aadb630..e5cb580ddb04b5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt32.cs index b346b4a010efb5..e130e771d2917d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt64.cs index cc776540fd08cf..2c80af9e52f3be 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Byte.cs index 4bdc783dff3341..aa99309423564d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Double.cs index 37b17811cb7e95..87bdf9df4d7ca6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int16.cs index 3da580361aceca..734f1ed4811ddf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int32.cs index 667739cdbc811b..5e1850b2d607c1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int64.cs index 953c81dc4492d4..8f8576ae0248ee 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.SByte.cs index 69164d36d77b89..b0130d00d62414 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Single.cs index 5f5ac261a34282..01b47a1b25956b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt16.cs index 89849cc83d5f48..5f2d0f64138d2a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt32.cs index 62fe0e6cb46ede..5fa2ecebe44528 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt64.cs index aba64cdeb6b1f9..99263bd3c0a6ae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Byte.cs index 10f94bcba3bb5b..915f334636761e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Double.cs index 7c522fb81731e2..ebd288c1783c0d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int16.cs index 37049790f8370f..e154f76606d036 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int32.cs index 27e68642fca5e3..4ca12873847d7c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int64.cs index b2349d0cd7f530..dac7283be3248b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.SByte.cs index 8aec4c9e5517a1..d2314ed8e3680e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Single.cs index b26f24ee0dc803..0169e28545a281 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt16.cs index 8abf7baec91e92..6b53bd0dfed484 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt32.cs index eebe34a0a7b0c4..58773449c37853 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt64.cs index ec980f61494250..c421df68c95eac 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Byte.cs index c6cb0660806b8e..9d2fd063d14064 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Double.cs index 4c4761a28e5c2a..ebbb3894db483b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int16.cs index 4d9f31b8dc6777..798e96550f9a82 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int32.cs index 27c5723862e2a7..9ba837e6a2cd96 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int64.cs index d2e7fe3d57c23e..ce837363d5a7b4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.SByte.cs index 9240add9f4932a..85384f6a632d63 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Single.cs index c3d1cc50b01c2b..990f23423f57c9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt16.cs index f7453639f3b59c..02c2565db4b6c5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt32.cs index 37b1dc6096d518..23e3b75994893b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt64.cs index 36c1805cd9cdf1..5c2882301655d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Double.cs index ab9051423d51e8..fbb673a84c339e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Double.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Double[] outLowerArray, Double[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int16.cs index 4e3ef1bcd395ca..63af03cab5c144 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int16.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, Int16[] outLowerArray, Int16[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int32.cs index df45c45d3051f5..c0cc88bd180eb3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int32[] outLowerArray, Int32[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int64.cs index 1db881fefd4a39..5106b7c5fa36c7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int64[] outLowerArray, Int64[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt16.cs index a0d60243cacd22..6a6369bc814d17 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, UInt16[] outLowerArray, UInt16[] outUpperArray int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt32.cs index b2484da4e93d16..388714ca726c1f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt32[] outLowerArray, UInt32[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt64.cs index c724c712f1b475..bdabc309aa86f4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt64[] outLowerArray, UInt64[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Byte.cs index 314369bff68e50..7e73775885ef35 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Double.cs index d4010e546c3f15..282a0a25aefc16 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int16.cs index 6ffb4e29802bc0..c6bcc9981ef7db 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int32.cs index c06f0df05dff43..c717be199d5ef5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int64.cs index 3566f2f80642b2..743486675d0523 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.SByte.cs index 4e7a096356db6f..149f671b6b42ca 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Single.cs index 3ce732de6e05fb..6a69bc9a7374cd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt16.cs index 654621d11ff83d..17eb4ed86094a2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt32.cs index 3212b2f02ba414..6f7d8996c785df 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt64.cs index 750463dd0274e7..cd000b673fdf8d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Byte.cs index b76d8aff225d55..26dac9f324a19e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Double.cs index dfab4fb1a989ff..0a611b6af7cfec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int16.cs index c87de044e8f59d..97767efcbe2d3d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int32.cs index 066fb9a009a043..543ca77f0d41bc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int64.cs index be56410a6d79d6..657e5bef13cc3e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.SByte.cs index 59d2e4a2f11f9b..b67c72e1585764 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Single.cs index fd7ba0a2870a21..19ef57cce0b630 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt16.cs index 82079982ab8545..2b35614490b4c1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt32.cs index dcd7c502c0e6ca..b8cf5449e9232a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt64.cs index 967afdc2562b15..738c079d86f449 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Byte.cs index 9f9d2df42d524b..0a916463d4165c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Double.cs index e7eb3282689d4f..490541b2a6575f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int16.cs index 3e42999b4a5811..6cefc48777efaa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int32.cs index 946ac2687b3264..334b71c55611b0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int64.cs index 02d8fdc8493609..bdee64b809dd2c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.SByte.cs index 585842062c6d47..2320d6aca30167 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Single.cs index b80d6b05889bdc..6d35d40ae8a4eb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt16.cs index db9c0896fa61f0..88039fd120e574 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt32.cs index 0de90af0052772..c912bde7cb62af 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt64.cs index d08ff67f6001c1..f987bba16acf4e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Byte.cs index 9b0dc1a6306352..316a3e4b9190f8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Double.cs index ada7855d0cbe80..b79b5aa8e3f1ef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int16.cs index 69f432e8c74346..c4fbdcc547d697 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int32.cs index 0eb11521fabcb1..5d4dcde0f0a3fb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int64.cs index 41c6d817e56ebe..903f3988442417 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.SByte.cs index 8ed05ca0f57a48..e3385e999219c4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Single.cs index 06b5fd2c0fa630..508a178c49eefb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt16.cs index 1b05eaa4f4da86..f8f968f03af7e4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt32.cs index d2f2d0f05e2342..96c5f7ccf5043f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt64.cs index 875ac2ed82b74f..4bb9669808dad9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Byte.cs index 1175d683ec5978..9d10ce33610290 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Double.cs index c30ce5d2a3b131..d73140adeccc7e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int16.cs index 3cc7d488bd6bc2..a2a660a383580d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int32.cs index e82b71e1b368bf..ded06e865b37b5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int64.cs index 9ba75ca2415efc..b3e86e3724b4f9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.SByte.cs index 445acfd8934311..185c6fee93851d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Single.cs index 6a74f4863e9e8c..c0f6b4acd949ee 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt16.cs index c4e6eb25d99e88..f159a7cfaf8d5f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt32.cs index 807a4749fc5298..e4e842c471b6ba 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt64.cs index 1092d209bfcffb..91f8257729e864 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Byte.cs index 047c1e7e4e45a7..792c20abe0247e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Double.cs index a97324667ab44a..312c732a607694 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int16.cs index 5e6949266d83ea..9916c680e437d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int32.cs index db0e64adc83389..ffab571861ab23 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int64.cs index b6b192ee74d8e8..34becd038d10c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.SByte.cs index a068cb53a062ac..dcf33227f45dc0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Single.cs index d67433bfad5778..b854ceaafdfb6b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt16.cs index 0ad15688b02b1d..9392315e6f379c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt32.cs index 5723b8578ffabd..5d218eb8bfc538 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt64.cs index b5ca9f30d306d2..6c4230ebd5c363 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Byte.cs index 3c360f015e19a1..80fc0db6279ce9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Double.cs index e41785cc49812d..8d17016980388d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int16.cs index e50ade29bb2434..bdb7815cd21488 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int32.cs index 62ea7456d8e36b..2c2ac072890400 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int64.cs index 95a0f94530a031..11a4a6a4d1a546 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.SByte.cs index ce8d6dcd951359..1903863fcfa79b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Single.cs index 1b88bdd783d675..57048fbcf2cbb3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt16.cs index b4459d8f4930e6..0fc90ab81a7fc5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt32.cs index 5e5d774034f66d..3a2516e6679eb3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt64.cs index 0e6967f88b0b24..0c2c11639e6a61 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Byte.cs index e49178dd21ba7e..511325765169a2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Double.cs index 05cb2192da4b08..84400c75f52aac 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int16.cs index 27f22cad8c89a2..f6fbbb14d4a086 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int32.cs index d4c765dd678cc3..27e56c4a89316a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int64.cs index c0f1f6d53429e5..2eebcfc82e20f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.SByte.cs index 870cf0a79d1677..07b1182adb591e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Single.cs index 1a58afc9232417..45b8f3bd5e637a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt16.cs index d901d813b714c6..4e2acbafb7b744 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt32.cs index b6afb904dd7abc..f0f2ae14c3de4e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt64.cs index ed23dd2251684d..3b50a0bd6e8e9b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Byte.cs index a0721548fc9592..2eabba2d059cc5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Double.cs index b66062437a9bb4..f458adff8f929c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int16.cs index 4254a6faff9f91..94d4cf613e6bab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int32.cs index 9cf9b5da51624e..103a61fd6406df 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int64.cs index ef2ee230de0bbd..59f02d4aa074d6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.SByte.cs index 5b3ceba9c70e79..bfa0c811504e0a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Single.cs index fcf8493c1906bf..9a5bc3bb42851e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt16.cs index c5e1b4e7c44bda..4198c65ef65e72 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt32.cs index 4492d7ead29c98..51271c248d7f14 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt64.cs index 4b856063150600..9d26037b30b3f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Byte.cs index 9122b1f46583e4..8ef15d2b878ac9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Double.cs index 4ba10fe2cbce0b..1abc9f441755c6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int16.cs index 6fd821763094c1..a627de270332ae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int32.cs index 86fb893323cee0..b4ab66e5491922 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int64.cs index c073777e8f7283..0282e5efd6a6b7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.SByte.cs index 4c958dcddae258..e8259b61a8a043 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Single.cs index 4a12b648f33c2f..fb61d74f94ea7e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt16.cs index b382b60b46f14b..8eb12a93192fd7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt32.cs index b9930754852c90..5483cdebc3ebc4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt64.cs index 3a54dd09b54cbf..725bcdbaac4913 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Byte.cs index 70915763174517..b558b83d93ce2c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Double.cs index 6bd5ef40c0e8d6..90b3d832feb869 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int16.cs index 31bf90038ae5bf..f742625ed29b33 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int32.cs index 9e164aea13811a..412a724eee46e9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int64.cs index dfe277f421207a..56525cb1cc3a9d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.SByte.cs index 671a5373f3d979..5d3d8b1ab316cf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Single.cs index b3d6809121d4bf..36413c54f783f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt16.cs index af91111a9aae09..785e1bc9494320 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt32.cs index f64d3d6f4b133c..ea9a7d92632565 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt64.cs index 0df590f17a1c80..2758a35b6d4ee8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Byte.cs index e4d76fed1a5004..3d59509a659409 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Double.cs index da803a098be93e..34600f640e4688 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int16.cs index 995fc1301e5cc9..7e0236817f3ce2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int32.cs index f61675050e83d5..770ebe2d603d5b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int64.cs index 7a3024e3cbc6e8..46cac9aadebc2f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.SByte.cs index 22b5eb2ad8a5ee..ee875efd2be3b3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Single.cs index 206a04b28263f2..6d8297aff97ffb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt16.cs index 594a5e1e4a9010..43d68a9bed77bf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt32.cs index 638f66e766109f..d68998460cdbd0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt64.cs index a3977f0148bc61..036646b07ab4dd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Byte.cs index c89475bb25a4ac..0204ea6f65fe88 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Double.cs index fb83e33491e720..5312ab03b4e1a1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int16.cs index 5f5cb7989c97e4..dc23684b52b17a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int32.cs index 345c16617698d2..49f671956e5fb7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int64.cs index ebb2e47a1c506b..241d628707d326 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.SByte.cs index 13081b5b0c8901..a547de44fb1fe3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Single.cs index bd9cf9188e8099..8e9fe5de87c443 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt16.cs index f627a6148fca44..31b7d699c9b38b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt32.cs index 6db91514fd7350..a23f478da1030c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt64.cs index 0b08df7dc0b226..34b743e1751e01 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Byte.cs index 7cf4590c5658d0..1c0cac81ff873c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Double.cs index c3ee9227911e69..04fd99dfc8be3d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int16.cs index aa1858eaa4bb7e..e184046f0470f3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int32.cs index 1358e6555cc4ae..2c4032c0bffecc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int64.cs index bc4d97249eb9c3..6a98ebb2cd2536 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.SByte.cs index 3812beb4121352..e5044ef905221b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Single.cs index 8327b95be75aa9..2f66217dfa67c9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt16.cs index ec9b143c9f9360..9932b064d6c0a5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt32.cs index 974bb03f3fbdfd..ca656deba71f81 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt64.cs index 06cdce6b5aeec0..1edf6ed9de4b5c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Byte.cs index 22de7b63e50fb0..0f0cf264a247f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Double.cs index 9f71e7dd08ac10..f7224a5154d449 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int16.cs index 93f8fee2e4b650..2a726dd778f873 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int32.cs index 17c7c29f277d58..2f9fb24aa010bb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int64.cs index b3e1b5bb9d886a..ad88942f1b8e0b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.SByte.cs index b3296ec60e962b..a19de79e9da1c9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Single.cs index 02c2345a9c57e1..f4ceb46684985a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt16.cs index 22b7e1d83115da..4bfddf31e002d8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt32.cs index 215dfbb41afc2e..db44547ebea9ad 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt64.cs index f8464b487df613..25e7f46bdd920c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Byte.cs index 16711035c30624..1f6bbe544b0a5d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Double.cs index 1ade698b070f2c..573d8227fa5d9b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int16.cs index 336f40d2004b5d..1c776039743154 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int32.cs index 02026e9ce2e89e..1a80c34ab97888 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int64.cs index a798901a6200ea..8213bc5d26cd90 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.SByte.cs index 727fae56778ac8..b7af3e9a3afe8c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Single.cs index 4eb739e5d121c7..62c407fc82049d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt16.cs index ade854041c2908..b8b74da205e8db 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt32.cs index 8d03705bbc450b..4a0058be8a80f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt64.cs index 995adf170d5969..48d66b35dbd9a8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Byte.cs index 1934bb2bddf7b9..c1db4d9dcae3a7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Double.cs index c2edb5c1720cc5..d15e5ba3421952 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int16.cs index e66fd3f806140d..81ffcc8928770b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int32.cs index e1099772c00d34..2ba2eaaa337b36 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int64.cs index 7bc22199c288c7..e1876421e6e927 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.SByte.cs index cf6acf66b057cc..0e945275d8014b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Single.cs index a043c1243bac3f..f975ecfba108fc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt16.cs index d7d617f44d6d9e..af5e66c7204ec9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt32.cs index 513fb792780e89..d2ffe9043a3671 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt64.cs index 90b74f04939c4f..7b8dead1a1e7eb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Byte.cs index 7012dea86b853b..3a0c9f963cfcbd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Double.cs index 47ee473f787f8d..bab713fc37f644 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int16.cs index 674b9e4b3e28dd..bd9673d7657a98 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int32.cs index fa19c118d8be36..967b164b4cecc9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int64.cs index 014689c7f55a3f..12c17cbb1b9d5c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.SByte.cs index 827a45a1c2fb2d..a0be4de8e7b422 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Single.cs index fa3525d326f9d1..fe4469395672c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt16.cs index 8436c9a4d563dc..4f4a6189113c1f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt32.cs index 83fbf2176cd302..9a3c0ebeb3662e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt64.cs index a7f7bb6741fb3e..bb593e9b7860a6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Double.cs index 26d6cee59fc904..cdbf111001fa97 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Single.cs index 923d2ea340ee40..0f1b159e9b5d89 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Byte.cs index a9baf520539450..67273461d3b912 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Byte.cs @@ -76,7 +76,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] inArray3, Byte[] outAr int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Double.cs index 354d6238a3a3e5..8422d4e533c41e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Double.cs @@ -76,7 +76,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] inArray3, Double int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int16.cs index 648f7ef19a40f0..9371032ae1d742 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int16.cs @@ -76,7 +76,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int32.cs index 72dc5f9e27391d..6afb636f2df825 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int32.cs @@ -76,7 +76,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int64.cs index 022aa8cc9d7b6b..8153a1d966f982 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int64.cs @@ -76,7 +76,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] inArray3, Int64[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.SByte.cs index 29905dbd3e6c83..7a1bfa6ad7eb4d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.SByte.cs @@ -76,7 +76,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] inArray3, SByte[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Single.cs index 02cb0ea658cb10..3d04c5d801e25c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Single.cs @@ -76,7 +76,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt16.cs index 1365f22f394a3b..13f7250186aa83 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt16.cs @@ -76,7 +76,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] inArray3, UInt16 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt32.cs index 42342abbf30caa..185e9943205a4f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt32.cs @@ -76,7 +76,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] inArray3, UInt32 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt64.cs index 3577e50410587b..4cfeb2732c9423 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt64.cs @@ -76,7 +76,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] inArray3, UInt64 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.Int64.cs index c44e95b46b9f6a..d7adb1831430c1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.UInt64.cs index 1aa28fc2089b42..adcd170d11ee32 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt32.Single.cs index 7699f979bca9f7..8aa3029768340f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt64.Double.cs index 1d3f2a777715df..9dca261314f02c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.Int32.cs index e55e86c8ad93da..c288659a5da88d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.UInt32.cs index a860a91ba66ebe..537526b2e6f4ce 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt32.Single.cs index 88ca8ec4dd51a2..c306030d2dd5dc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt64.Double.cs index 550fdfc72bd48c..9e2072b208ad5f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Byte.cs index 17dd4531e50680..3731c964e3ea0d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Double.cs index 5953e5cd14b5ef..154f0c62549ccf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int16.cs index ae0b977b86dd25..167d243687306f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int32.cs index cb73d60b04e8c7..1510afd4e826b6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int64.cs index bdf70e352653c5..e6035dd2233fa8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.SByte.cs index aae38738924b5a..f15d67a48a88d3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Single.cs index 3b06c690efdbd5..83219ce3b38155 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt16.cs index 2a92aa7e7a2f4e..cf63a61f7b7778 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt32.cs index f8944849bfad16..4f80f46a02ed2c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt64.cs index 82e24be513a5af..bfd5d060de48bb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs index 8c1916f0a858b2..c6dca2efa7508d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs index 3e16d1b52a0977..cc33be50181db4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs index 283182815302ee..e7b6a5b22fbb2a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs index 6cef7996fa5511..d318880a582983 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs index 81afde657ea149..9c4951860a5d97 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs index 00cbbbb9d74c54..40af3cc2c5bc30 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs index 07eb92525d3df3..72e3641dda7da5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs index faf377ba303073..ab0d388a277367 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs index 2cf6647483e17b..01953a6fb31fa1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs index 8fddb15edc6d4f..4705c52a5774b2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Byte.cs index b9e3c51375f338..ec2bdeea676e4a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Double.cs index c552c6a770c441..9698b38d8dbb0f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int16.cs index f9962b9c70bef2..dbb9b34dc39f83 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int32.cs index a6c0629223c042..77f942b56a3f14 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int64.cs index d53a99239fc0d5..44596d77068d20 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.SByte.cs index 4fb2459a65f0ac..ca4ba061a0ab7e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Single.cs index dda646763eca3b..730ad8e4c4306e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt16.cs index e8a0b35594b005..5d3c8518fcacf1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt32.cs index 075bb61379a22e..bbd13ee7b561d1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt64.cs index 651e277c1dcd1c..801c54b44a0832 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Byte.cs index d1a4b431a7bcfb..f8c677b6b1e80a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Double.cs index d0fb752c0b8788..9e76246f43c3c5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int16.cs index df7a71712d5ffb..e3bc6dacdfe4e8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int32.cs index fddcfbb4d8aab5..432471ed2e3c36 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int64.cs index cc045b56295a48..2d0caac74ab138 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.SByte.cs index 1bc9c5ba643a9b..d4c54696b7f516 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Single.cs index b797aa6a96465a..f6991c67139650 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt16.cs index 04d8493a6d199f..b5d19dea2c4e67 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt32.cs index 54a5d0af5fb290..77e505fa363db1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt64.cs index da7d5cddaa010b..920467b5d95d87 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Byte.cs index 42917a870e0bef..64ffd96302582a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Double.cs index 9d3b85d0adf979..f39185105c5939 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int16.cs index 9986850a5ebc36..7c47cb18c08517 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int32.cs index 4480e789f1bee8..8cb1293a419bb1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int64.cs index 7d0da5fd1fa552..617b50ded3c645 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.SByte.cs index 2dab1c39c57c9c..56fee670fbc488 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Single.cs index 670fa1bacb6d8f..071134d7bbc1a6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt16.cs index c0352bad65cd47..17b8f86386ad72 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt32.cs index 2f7fd91bd2fcfb..24a2b6dd42ce11 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt64.cs index 3d0f4c734847a9..8f85da0a2783bf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Double.cs index 0df8dce07b9ca4..571b320cc18b3c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Single.cs index 11e87acbdf9877..482c47dc7e0a5b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Byte.cs index c66805b2d07d13..460284984d74ef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Double.cs index d3f86cf384cbd5..26c0e4dbb24958 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int16.cs index 83298bd8e5c2b1..2fbaf8af10f14c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int32.cs index d9f5f50dee00c2..b27dce906f3d79 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int64.cs index beea137784b32c..4b27e53f0fe033 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.SByte.cs index 2bd579a0ed8323..727eb1b4f07474 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Single.cs index 25afb712ab9a2f..98742a934e141b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt16.cs index e7ae7661661c13..7ef1d623030ba8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt32.cs index 116e07ed28a203..d3f2b8a9f49bfa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt64.cs index b8c51a10a5a475..3dacdec450c2c4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Byte.cs index 0a788f005f1549..6b1e528a642563 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Double.cs index e956dec0d7a752..056a1781989955 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int16.cs index 86c0bbcf81d345..9a2ab28332cdb7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int32.cs index 59035aa3d76096..7d85a7eca3fd88 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int64.cs index e0848576aa97e6..e8321343f25887 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.SByte.cs index 750792db8e0e7a..6b1c23db8adb59 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Single.cs index b5d2c695678d6d..4f6b75fdb51230 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt16.cs index 1f768207168c74..e0b2a9d68d034c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt32.cs index e186c0ce4a69eb..167746d6f07235 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt64.cs index 02ddb5fd779d82..7f7a97c0ad3998 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Byte.cs index 4cfb1d07268fc5..9acf0ea1e83afb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Double.cs index 5174ffea7682a6..868311cb426697 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int16.cs index 7b16f0de974fb5..95d766f4b45b6c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int32.cs index a01482892ab8cd..2a61214bcf80f7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int64.cs index 63271a8eb1af6e..6d4c6056de46e2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.SByte.cs index 82a14d0077cd33..f2bd648e1feb9c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Single.cs index 683cf82d1da27d..ebc1a2c200a449 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt16.cs index 1cdc897928aa90..e3a91843b8379c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt32.cs index a8566763fe084d..a659abce52840a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt64.cs index 612a7780fa5b3f..d410eced03f478 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Byte.cs index 28f7e6333968d5..b7436f18317417 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Double.cs index cb4daf7dd00d9c..8c811b06310e2c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int16.cs index a3a39769e9a72a..ba900fe7a1a847 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int32.cs index 22576427104a57..f027b1c5de56b0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int64.cs index 76ef2ea1cc7410..4f0296a4a5b6d8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.SByte.cs index 07b14051dbf121..4c3038f6cb1278 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Single.cs index 59fac01600be4b..7c9593488c0164 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt16.cs index c28e224622f1ca..751c8e06074ccd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt32.cs index a93e224c11edce..b25b5d2827d89b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt64.cs index e9739b30403b55..56a4538a4cfcf1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Byte.cs index 6af0edb07800c6..82ba9cf1e14d26 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Double.cs index 4748e0a27c13d9..c2f21bb686ca70 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int16.cs index 7eaf5c398d9c27..cfc7e7d0096bb6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int32.cs index 6d3e9eed661f27..96cf549e6664f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int64.cs index 9c085e119f7484..7aedf44cfd0239 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.SByte.cs index dbb2a971dfba4e..cf15c8f7dcb4f8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Single.cs index f5b567f55b68c0..c6137ac81c5887 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt16.cs index 1dcb4daf1f7104..43cb6306148206 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt32.cs index 1826dedefdd8ae..6be1492353bd2e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt64.cs index 7066f72cbfc711..23752c2903817d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Byte.cs index 17f4fe254820e4..2d2cc42465ad01 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Double.cs index 2034aa4bcb5782..eba13f7aa5971f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int16.cs index 9afb2c5ad58453..4cac4c4db500c8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int32.cs index 6be8a5c0192619..046304204074a5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int64.cs index a19452ca0d0a5c..00c35e89d7225e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.SByte.cs index f7dfb94e4bb243..27475b73ed761e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Single.cs index fde2d47a6e424c..5ad4482d2dfffe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt16.cs index 86952b2cb0d632..b75985f4640b2f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt32.cs index d78dc7b5c01871..2eeef06c3ffaa1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt64.cs index 4d28b038520306..fbb90b5adfda71 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Byte.cs index af96b59f406a96..c533096db4af69 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Double.cs index 2e16324099c094..0cb23fd7e72f55 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int16.cs index 937a591ceefb8b..9deb07086cd99e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int32.cs index f832296add5392..41601d973d1eb0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int64.cs index 7048e880bf2462..ae9539fa7e0db6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.SByte.cs index ce93263d7cc8a3..4b69d8decacc52 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Single.cs index 770b8c332855e9..f99372a3a14fec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt16.cs index 2f3b5b5ac77554..2a08e21d4465ad 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt32.cs index cf6f1dd728a080..be1d2cab31916a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt64.cs index 15bc351a3232ff..1c8c01c1ed312d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Byte.cs index c94ffe18c306ce..051569dad64cda 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Double.cs index 38f385775c4c99..648a508e8c0b03 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int16.cs index b41e25a6c6f0c4..903dd734c00768 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int32.cs index 2265dad9d40915..5aff6bede7dc39 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int64.cs index 10632756736019..887396d4b0ae6e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.SByte.cs index cf5047c1c9bcba..33ebc47b4725ef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Single.cs index 3ab70a2ec9c0cc..0c19674b0e5001 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt16.cs index 9baebe874d9825..ea61b6198a534a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt32.cs index 79f3f4ecc0a906..4df58c995741d9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt64.cs index 1280a65c0aaea6..95fbabb688854c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Byte.cs index b9d1b9e636271f..648453d24e9819 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Double.cs index b0c4b1bb85f040..4c880dfb494aa0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int16.cs index 7b57110c44195b..7c428b72fd68ab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int32.cs index a10c4dd1fc1138..e186a627bc9c32 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int64.cs index 9bd1e580360b3f..3e3d119c3741da 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.SByte.cs index 0a2a418adb76f1..10fdf8c2fa487d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Single.cs index cce869ccda2788..a511c104e904bb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt16.cs index b13e712beff2f7..2212f8ddef1b90 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt32.cs index 46c8073131aa31..caf3f9de806e66 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt64.cs index a3457fd036a90b..59019288867337 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Byte.cs index e9f72bfad7dfb3..d0db3605a24674 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Double.cs index a3794652de6b03..4a6b0ed0a79c4e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int16.cs index 0dc54a822f88f9..640b8169a8b302 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int32.cs index 314b41ceb3e813..e85172b2df78e1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int64.cs index c4fa9f3fd6e5a7..e6a5d095de634e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.SByte.cs index 32b7065a85b379..8b92416835c20d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Single.cs index 4db8f3452008e1..21a9734165ecbd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt16.cs index 8074b7500475eb..4fe7f45c26fb08 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt32.cs index 838dd5acf6477b..db5d18df326414 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt64.cs index 5eea2cf8a4b328..77b98f6b133b44 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Byte.cs index f3e86eb0a78454..3d7bdaa553012e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Double.cs index 04ec56077d07c9..e4d2483555d3d7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int16.cs index d958683e6514f7..10fea63d9c07ee 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int32.cs index f0fcd339220e24..0ccc9f8287bec0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int64.cs index b98274bbc1fc8f..e306c09d8103da 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.SByte.cs index 635b0c54490b38..f5adf587d61da0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Single.cs index 773734c3ea32b1..5d8d858db3764e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt16.cs index daa940c382ce5c..35823273d1701d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt32.cs index 6d2539df18dd56..fd20eea068e8e2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt64.cs index 06ff1e9c0a9aa0..bf9bdaedba02b6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Byte.cs index 191fbda6b49d54..4e2357cc6b7651 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Double.cs index ad93b74b9a99c7..3ec6c095d9f14e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int16.cs index 476791a78b441d..d4f756c2978091 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int32.cs index ea2e1a4d720089..c8aef93d50ccd1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int64.cs index 4a0c21539829e1..a18bfe4a225a60 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.SByte.cs index 87ec23d9247e51..d0dc240978c7c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Single.cs index 0be70558dc1bfb..6de7bc6a6d51d1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt16.cs index 51113f57c60dd5..d9ba96e8262c62 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt32.cs index 71c70b65120fc6..410fefffd8d65d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt64.cs index 53a5546b49a5b6..881816aef28d41 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Byte.cs index 7989afa988ba64..eb297adb545c38 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Double.cs index 8a7f96ec4bd3a6..5d132fc77e6e3e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int16.cs index 50a4b7a5ecda7c..a7f285ae505e9f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int32.cs index dc015a84911c91..1d0633e0927b3f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int64.cs index fa10ebf5b4a2f9..aa0b7e90667759 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.SByte.cs index 4c80c7a4056b97..272cb288e67b5a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Single.cs index b48921152e80a8..232d88542a59be 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt16.cs index 412858e43199d8..6759340c10f983 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt32.cs index 446bdf84dc7d7d..79efe1241e6e40 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt64.cs index 69939b43dd6ca2..daff133422c16e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Byte.cs index 5b2990a20de02d..888183fbf4243f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Double.cs index 580a669ccbf7cd..dd7234e6557dda 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int16.cs index bf2d4e160008e4..e21535e71ac244 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int32.cs index 19582707d2d196..01f2db58ccabd5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int64.cs index abf12400a9ce29..831d891f517d65 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.SByte.cs index 3a217cee2c9d48..8fdf6b476403c1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Single.cs index 44bb74c57d83d0..534413b1b1010a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt16.cs index e12476c8e74707..e59fabb1bc0c88 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt32.cs index 9c5e7f8d656a5b..47258286a73c65 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt64.cs index 480c9a90f2e3ba..2aa0a906bfa94f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Byte.cs index 09ee6be434f0b3..6ffa52360e3956 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Double.cs index 6e91f67370f1a6..67b7d2b2468994 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int16.cs index 651c842a067621..77da725e8ad714 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int32.cs index e5fa07d62aac14..dca87ac2e62f46 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int64.cs index edb50aad4b9b9d..bb737232eb9669 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.SByte.cs index f72ac0702c1358..37dc982d09ea61 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Single.cs index 0167b87ebb9d48..c176d3a2db7988 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt16.cs index 4eaf2c00d16b88..f3119c15fa50ab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt32.cs index 24823d53036d05..403812874bac94 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt64.cs index b3b09be8c60dd1..c774c6ec9c70eb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Double.cs index 1516d52ba65d5a..a0f6c6781bc162 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int16.cs index d52335f6eafb47..8a1bb0fa263f3d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int32.cs index 02dca722991bf6..f591f78ee1a775 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int64.cs index d97613e9da88e7..06089434910aa5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt16.cs index a9cffb0191c61a..a7a3294b758a4c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, Byte[] outArray, int alig int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt32.cs index 5d1f5d68f67b2b..71bb2c64113101 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt64.cs index 3b5f0f75716c60..64d21392c84291 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Byte.cs index 14cbccae435b5c..930321988577ae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Double.cs index 4865168ed9d675..ce91b6d1d54d19 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int16.cs index 083eca24b99be2..687a37cb9348a2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int32.cs index b7d20a64b07bd3..c55118a4a3656c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int64.cs index c4453681c1fad7..ac42ac9cbf1096 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.SByte.cs index bf764cbb21e092..994987db0e3867 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Single.cs index 77070681283de4..e6cbf58206d80b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt16.cs index 15fe3a1181fcf0..2e9476787c08f8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt32.cs index a674716c7687fa..5c7631fc0484dd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt64.cs index c4d753aa24567e..44953de69ecd65 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Byte.cs index 2806f7dd70a906..e589b55157fca3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Double.cs index b049749f6b7fdf..56271cafe3524c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int16.cs index 429fe34b1e2a95..7543834e84f226 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int32.cs index 5f644ca7d5d88f..25223621b24374 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int64.cs index f29e6bf2de7f69..a0979097afe33c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.SByte.cs index 7c0cda7006a432..65a9a439fe8002 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Single.cs index 44dc6da1202b05..7c4f4dbac9cba1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt16.cs index 45150ca658f0b5..b92d5907d6ffaa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt32.cs index 8a7e15681518de..3c7ca65a46d023 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt64.cs index 05d185cb3344ca..efc64905701610 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Byte.cs index 7b3100ea327e8f..f56508ce1188cc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Double.cs index 8b1d3bdaa53f89..a885e0dbd4dd78 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int16.cs index 431992e1f74e23..019672f2e2dab1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int32.cs index 8255690aeddc56..f871a42ad62ac0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int64.cs index 5d390fff17ab20..292d09db9fb81b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.SByte.cs index c63f4dd4e452b5..c14fa03b3f2af0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Single.cs index 5ae409fc9c6baa..40994f4dfecfa5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt16.cs index 7e2c9a9beba814..4f2d048fd8b0a6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt32.cs index 17acab4aeb0d9c..21f539b5a83521 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt64.cs index cb0d0cd94f15f7..57b30e3bfaa8b6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Byte.cs index 6631abf5803ce0..763fa64258d433 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Double.cs index 4f0e79336b28cf..56196801674b0c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int16.cs index ed7013d35c3411..c5fc582cdac80a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int32.cs index 319f7239e78adb..711abc8e481bb4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int64.cs index 30eceea6355c4c..b27ca49d6153ba 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.SByte.cs index fff3b3eb68309b..8b5db019b5d5e7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Single.cs index 8ec5cb059d4423..743bc151bcec39 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt16.cs index bc2e34c71483a8..36e3e5956fde3a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt32.cs index d727d667b1dac3..2c2b3053bb7c98 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt64.cs index 6cda1c1092e495..402cbe7ca573e1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Double.cs index c54650cc0bd344..3fa88d6d1edf7d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Double.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Double[] outLowerArray, Double[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int16.cs index 8df7cd4d3a31ca..5e299275c893f8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int16.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, Int16[] outLowerArray, Int16[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int32.cs index 9b1dd573496c00..55f20a2d5ead8a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int32[] outLowerArray, Int32[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int64.cs index cbe55d62bef490..82eab00fe1caac 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int64[] outLowerArray, Int64[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt16.cs index 38c659c3718151..9d488ead547cc2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, UInt16[] outLowerArray, UInt16[] outUpperArray int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt32.cs index 3cd88a3562acab..9600b82d342383 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt32[] outLowerArray, UInt32[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt64.cs index 794a88ef8cfe91..e51648d18e9cf6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt64[] outLowerArray, UInt64[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Byte.cs index 473c3ca515c46c..c556759272e6ce 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Double.cs index 8ae467c2228fd4..9c9fc9dac079d7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int16.cs index 50a46cbc3f9fe1..3044cb5c2b69c7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int32.cs index 11277a4d196a89..cd24c256ef38af 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int64.cs index ca8cab8adc8f61..6fb676009d6c48 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.SByte.cs index e6a66d1f6c697d..b5f1999e245fea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Single.cs index 0f31ba087ffefa..a83c4700a59cfa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt16.cs index c7363316f2be61..d782cad2fcaad5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt32.cs index be3582d4029be1..7521df516a765b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt64.cs index 57050e9d3a37d6..fb4707c0d2cade 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Byte.cs index d595a9034f901f..4d795afd958e98 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Double.cs index 4656b99300e91c..37bee6120d470d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int16.cs index 52c66bcd58aa17..4bed580e4b6452 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int32.cs index b9592a29576377..45528d075a5f7a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int64.cs index 452fecf5b9f3d2..9a84ece57a1459 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.SByte.cs index 9053245544ea2c..0166c84fe3520c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Single.cs index c086fee7a91212..3a5795d0736232 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt16.cs index 4966192bcb4c01..8cbbbebbd6858d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt32.cs index e4aed050fa08c2..ba1a2e37461eb0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt64.cs index 6f38b7a38a0e6f..0c09b8d6605e0c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Byte.cs index 99650a1517c701..c15a9d72624d75 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Double.cs index fb35d95ca9b673..ff61dba4df037c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int16.cs index dbb6580f8e3646..e5402af9f72a53 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int32.cs index 990acab3178356..3e9e9f7876d21a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int64.cs index f541e5b92ec03f..9983160f61e327 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.SByte.cs index 62fb0ebe69babe..f84dc6c36feff9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Single.cs index 4520e3985055be..880e2dd2ce00fd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt16.cs index d8232f0d75efe6..99a00024599b86 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt32.cs index 13d800ea64e506..8dae38cc0659f4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt64.cs index 5e1a8ab2c508ec..b5a39f72ff83e9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Byte.cs index 7207b68507fb4c..0426a538037f26 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Double.cs index 3b85f7a53abc52..a22c6312fdbe69 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int16.cs index 35217ec3b989d2..41c13faafe332f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int32.cs index 9dfd95e9cb696d..2c95c3c54324c1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int64.cs index 75fc58eb258398..d72cae0aeb0b06 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.SByte.cs index 0e995da5c6615a..3e9b0ccbdea4d7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Single.cs index 7f4052ace82a70..f1d81e5c5ba38a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt16.cs index e789b676480f8c..7fb2d13f7e559c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt32.cs index ffea39d8092977..5124954d09e9fc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt64.cs index d032f6a1ac54b7..c97081a8c5b35c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Byte.cs index 5d900cd517164b..ed9b88677554c5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Double.cs index f287bae243a514..3e29920f26218b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int16.cs index 1cb768fa698838..ea8ab23e8a1576 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int32.cs index 8b7a7c38c24d72..c71e84a26abb79 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int64.cs index 867f03959f0850..e713b406447da0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.SByte.cs index 9f3c3bbec73a6b..97f0645ab3e031 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Single.cs index 0e286b086d9f8d..ac51e74bbb69cc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt16.cs index 14d124220270e8..c3316c3a339f80 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt32.cs index 82694d32784ad1..dda86205cb0bac 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt64.cs index 07bd13d78429d3..ad78479ab7bba3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Byte.cs index d666cfc618605c..41085052f6c458 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Double.cs index 07e3603a89399f..3dcb3920eb15f9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int16.cs index b96a373382315b..43a1b90ba20f75 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int32.cs index 39b1fbee523002..131e18a4881d6a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int64.cs index 09442fc21cac48..7f17edb734c94d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.SByte.cs index e5eadab3dba42e..4ae9706f89fc20 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Single.cs index b54413e6f0fa61..96dc6064cb2029 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt16.cs index 65d8e12c86a2d5..e34aaaca21e040 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt32.cs index 05949053bf1b96..8e158efced4eca 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt64.cs index d5bf3f32a90824..a7adc66c5c12ed 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Byte.cs index c975b052bd974f..c189b3c297c014 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Double.cs index 88351b78e7a73c..056993d703e499 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int16.cs index 550a4a292d7265..6b8185b61fdb87 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int32.cs index f36e79b29a397a..a2ef9307194752 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int64.cs index 13350b335c7b6c..f0243660596b9a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.SByte.cs index 2f02135e12e7be..3f4357c86af1bd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Single.cs index a5edf018c46f94..a1f0c5624f4c09 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt16.cs index e1f945b43fae0c..15c66755b31bb0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt32.cs index fd7ead2afb1da6..63c64baa1395fe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt64.cs index f197e84ad6ca7f..c6434eed0ddf4b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Byte.cs index 890af437d0daf1..23bd13cd0b256d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Double.cs index 5dc02bf9649229..d9d134cf9714d6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int16.cs index 5a584bf7bc3c5d..665091c9c212e6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int32.cs index d03e47b00af5ef..ccd18e468268bb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int64.cs index 2ba022d7484fd9..5defc877605921 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.SByte.cs index 8862113b9ddfb7..9d142c936dca35 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Single.cs index d1a234a42f31ce..cee84a404cc6f4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt16.cs index a7747048fcac3e..910270aed74572 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt32.cs index 327943d4986747..3a123b3d991f8c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt64.cs index d63988f1999a40..041d0539db15b1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Byte.cs index 41bf13c2ed811d..7192d0b24dc0f5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Double.cs index 16c0016e3d0c90..019150e52c6d88 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int16.cs index d597a34d341603..491fd9b9149146 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int32.cs index 98167cbc3ccd77..113e6e625efe00 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int64.cs index 13beed38b6cffc..fc4f3b57baae52 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.SByte.cs index d21c18aa0debf5..30a32fe2183df0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Single.cs index 63f370ee277650..7510d3488bcfe7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt16.cs index 384209ece0f309..a565c5196da70e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt32.cs index a3e44831c7c12f..574b5c0e201485 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt64.cs index 63faf37e3cc922..08b24d4f8dcc74 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Byte.cs index b78810e542dc1a..641d881b923af6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Double.cs index 92a5f634ed92bd..09c9459d3bddc6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int16.cs index 6aace3b6cd0945..e068740a6e9f92 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int32.cs index b1c9ce989c033c..5aec614e6f615d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int64.cs index fcd88c9ad9d3d8..b99ddced7a066f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.SByte.cs index 24400e139c3896..7c71cee32ed16d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Single.cs index c409ccd09831f9..93e9abf0b1ae2b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt16.cs index 79116507b9833b..b549db17ab8f8a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt32.cs index 3faa70a13ca11c..2a38b2214f5438 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt64.cs index f92eac5df4b05f..84b175513ca4b0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Byte.cs index 221d69fbefe56f..983ac4906627c0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Double.cs index db5eb1d9a47bb3..e7fe21becea4c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int16.cs index 0c06170dd079bc..625a635fa911f0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int32.cs index ca6c38765c506a..c266ecebf21307 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int64.cs index eb105d992a2b74..1be94fbc5bb386 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.SByte.cs index 88bc61ad64115c..534c9c0e16e57c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Single.cs index b6b3324763689b..c567b830869f18 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt16.cs index 4ffb85410f884e..a8e06ff5db79b9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt32.cs index 23a4fea6b96661..4e1ed7f6212746 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt64.cs index 3ecbb3482c5116..ac3d0fd79f5979 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Byte.cs index 783ad40bfdfc33..897d8bb61b77a5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Double.cs index 522afa13365b0e..3d27ad7da9f17c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int16.cs index 0ee518f37f0a17..01c14c95fb572a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int32.cs index dc92b8da44c31f..dd322b0e8461a4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int64.cs index b02a23aadeba13..d2f9568eb371a4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.SByte.cs index fa3abb749a356f..6a6c7d4db1732c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Single.cs index 4c3a0baea853fa..8663ef70785115 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt16.cs index c7be61abcfa196..103f217e740a33 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt32.cs index edd56a5b7fa2ff..0bf93c76c6dd3d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt64.cs index abfe5ac23b14b5..a3bb742f404d15 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Byte.cs index 8aa5d7640c1e9d..4b83724a263804 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Double.cs index 646785bed85d68..66ec6cf102c5cd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int16.cs index 81ec307deacd38..a85b0e6c23d3ae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int32.cs index 5954bade3e8b6c..78191c1ea98628 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int64.cs index a4ea207269ee2f..eb9a71d812fdd6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.SByte.cs index 08a883dc60497a..8f959a108d267a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Single.cs index adbbc0d03709f1..94e47abed3d5ff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt16.cs index 440b8795d8e2fa..52b7e9d2b119f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt32.cs index 22cbd383a2ee7e..c50723d2672e5d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt64.cs index eb84ffe5b51ffe..d9dbeb4b21f7a6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } From b8f0a167f62713d6996c447ca5f98ac983b70c8a Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Sun, 13 Nov 2022 08:00:46 -0800 Subject: [PATCH 11/26] Ensure the vector Dot tests correctly sum using pairs --- .../src/System/Runtime/Intrinsics/Vector64.cs | 21 +++++++-- .../Regression/GitHub_75791/GitHub_75791.cs | 44 +++++++++++++++++++ .../GitHub_75791/GitHub_75791.csproj | 10 +++++ .../General/Shared/VectorDotTest.template | 23 +++++++--- .../General/Vector128/Dot.Byte.cs | 23 +++++++--- .../General/Vector128/Dot.Double.cs | 23 +++++++--- .../General/Vector128/Dot.Int16.cs | 23 +++++++--- .../General/Vector128/Dot.Int32.cs | 23 +++++++--- .../General/Vector128/Dot.Int64.cs | 23 +++++++--- .../General/Vector128/Dot.SByte.cs | 23 +++++++--- .../General/Vector128/Dot.Single.cs | 23 +++++++--- .../General/Vector128/Dot.UInt16.cs | 23 +++++++--- .../General/Vector128/Dot.UInt32.cs | 23 +++++++--- .../General/Vector128/Dot.UInt64.cs | 23 +++++++--- .../General/Vector256/Dot.Byte.cs | 23 +++++++--- .../General/Vector256/Dot.Double.cs | 23 +++++++--- .../General/Vector256/Dot.Int16.cs | 23 +++++++--- .../General/Vector256/Dot.Int32.cs | 23 +++++++--- .../General/Vector256/Dot.Int64.cs | 23 +++++++--- .../General/Vector256/Dot.SByte.cs | 23 +++++++--- .../General/Vector256/Dot.Single.cs | 23 +++++++--- .../General/Vector256/Dot.UInt16.cs | 23 +++++++--- .../General/Vector256/Dot.UInt32.cs | 23 +++++++--- .../General/Vector256/Dot.UInt64.cs | 23 +++++++--- .../General/Vector512/Dot.Byte.cs | 23 +++++++--- .../General/Vector512/Dot.Double.cs | 23 +++++++--- .../General/Vector512/Dot.Int16.cs | 23 +++++++--- .../General/Vector512/Dot.Int32.cs | 23 +++++++--- .../General/Vector512/Dot.Int64.cs | 23 +++++++--- .../General/Vector512/Dot.SByte.cs | 23 +++++++--- .../General/Vector512/Dot.Single.cs | 23 +++++++--- .../General/Vector512/Dot.UInt16.cs | 23 +++++++--- .../General/Vector512/Dot.UInt32.cs | 23 +++++++--- .../General/Vector512/Dot.UInt64.cs | 23 +++++++--- .../General/Vector64/Dot.Byte.cs | 23 +++++++--- .../General/Vector64/Dot.Double.cs | 23 +++++++--- .../General/Vector64/Dot.Int16.cs | 23 +++++++--- .../General/Vector64/Dot.Int32.cs | 23 +++++++--- .../General/Vector64/Dot.Int64.cs | 23 +++++++--- .../General/Vector64/Dot.SByte.cs | 23 +++++++--- .../General/Vector64/Dot.Single.cs | 23 +++++++--- .../General/Vector64/Dot.UInt16.cs | 23 +++++++--- .../General/Vector64/Dot.UInt32.cs | 23 +++++++--- .../General/Vector64/Dot.UInt64.cs | 23 +++++++--- 44 files changed, 810 insertions(+), 208 deletions(-) create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Regression/GitHub_75791/GitHub_75791.cs create mode 100644 src/tests/JIT/HardwareIntrinsics/General/Regression/GitHub_75791/GitHub_75791.csproj diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs index 6a897cd90364ae..d2eccac1d18913 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs @@ -1101,10 +1101,25 @@ public static T Dot(Vector64 left, Vector64 right) { T result = default; - for (int index = 0; index < Vector64.Count; index++) + // Doing this as pairs is important for floating-point determinism + // This is because the underlying dpps instruction on x86/x64 will do this equivalently + // and otherwise the software vs accelerated implementations may differ in returned result. + + if (Vector64.Count != 1) + { + for (int index = 0; index < Vector64.Count; index += 2) + { + T value = Scalar.Add( + Scalar.Multiply(left.GetElementUnsafe(index + 0), right.GetElementUnsafe(index + 0)), + Scalar.Multiply(left.GetElementUnsafe(index + 1), right.GetElementUnsafe(index + 1)) + ); + + result = Scalar.Add(result, value); + } + } + else { - T value = Scalar.Multiply(left.GetElementUnsafe(index), right.GetElementUnsafe(index)); - result = Scalar.Add(result, value); + result = Scalar.Multiply(left.GetElementUnsafe(0), right.GetElementUnsafe(0)); } return result; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Regression/GitHub_75791/GitHub_75791.cs b/src/tests/JIT/HardwareIntrinsics/General/Regression/GitHub_75791/GitHub_75791.cs new file mode 100644 index 00000000000000..65eac2076713e5 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Regression/GitHub_75791/GitHub_75791.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements.( +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.Intrinsics; +using Xunit; + +namespace GitHub_75791; + +public static class Program +{ + [Fact] + public static void TestVector512() + { + Assert.Equal(2.9288656946658405, Vector512.Dot( + Vector512.Create(0.28391050802823925, 0.33383399868214914, 0.6393570290293658, 0.9486867509591725, 0.03499340831637021, 0.8440502669865283, 0.9382154950924279, 0.9638167025024158), + Vector512.Create(0.1982700660390313, 0.3166301813003236, 0.6653102738185168, 0.9267781773486286, 0.8465606085980281, 0.9969451724464531, 0.2048630727349331, 0.4139565663463529) + )); + + Assert.Equal(3.1271863f, Vector512.Dot( + Vector512.Create(0.9997464f, 0.3368471f, 0.4043606f, 0.40446985f, 0.8205302f, 0.96234834f, 0.033238932f, 0.4785298f, 0.5980946f, 0.035252146f, 0.466319f, 0.48365256f, 0.95094615f, 0.76286495f, 0.058176957f, 0.044761457f), + Vector512.Create(0.192693f, 0.65009266f, 0.73478293f, 0.45294976f, 0.32503143f, 0.096156664f, 0.20120476f, 0.09926898f, 0.4980145f, 0.89575404f, 0.700502f, 0.92765516f, 0.06838739f, 0.7633024f, 0.5538336f, 0.83792007f) + )); + } + + [Fact] + public static void TestVector256() + { + Assert.Equal(1.8913451f, Vector256.Dot( + Vector256.Create(0.4797493f, 0.12908089f, 0.65387505f, 0.3784436f, 0.82727f, 0.25609037f, 0.72052014f, 0.11474159f), + Vector256.Create(0.4786259f, 0.17519481f, 0.47962677f, 0.19132254f, 0.9456166f, 0.88822955f, 0.291491f, 0.2903679f) + )); + } + + [Fact] + public static void TestVector128() + { + Assert.Equal(1.2333127f, Vector128.Dot( + Vector128.Create(0.5355215f, 0.9093521f, 0.9310961f, 0.11439307f), + Vector128.Create(0.500749f, 0.7528007f, 0.26315397f, 0.31093028f) + )); + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/General/Regression/GitHub_75791/GitHub_75791.csproj b/src/tests/JIT/HardwareIntrinsics/General/Regression/GitHub_75791/GitHub_75791.csproj new file mode 100644 index 00000000000000..74fe39137ccda2 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/General/Regression/GitHub_75791/GitHub_75791.csproj @@ -0,0 +1,10 @@ + + + false + Embedded + True + + + + + diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorDotTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorDotTest.template index 547780ee4a23b0..1da96e45b01465 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorDotTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorDotTest.template @@ -296,14 +296,27 @@ namespace JIT.HardwareIntrinsics.General {RetBaseType} actualResult = default; {RetBaseType} intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128<{Op1BaseType}>.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128<{Op1BaseType}>.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + {RetBaseType} pairResult = default; + + pairResult += ({RetBaseType})(left[i + 0] * right[i + 0]); + pairResult += ({RetBaseType})(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += ({RetBaseType})(left[i] * right[i]); + } + else + { + intermResult += ({RetBaseType})(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs index 99bbfe8731d29c..e02de75484e93b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs @@ -296,14 +296,27 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe Byte actualResult = default; Byte intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Byte pairResult = default; + + pairResult += (Byte)(left[i + 0] * right[i + 0]); + pairResult += (Byte)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Byte)(left[i] * right[i]); + } + else + { + intermResult += (Byte)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs index 7efe42656d4881..d11ab76ada9558 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs @@ -296,14 +296,27 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle Double actualResult = default; Double intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Double pairResult = default; + + pairResult += (Double)(left[i + 0] * right[i + 0]); + pairResult += (Double)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Double)(left[i] * right[i]); + } + else + { + intermResult += (Double)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs index dd9bb64e7453cf..ca0d3ef920f34f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs @@ -296,14 +296,27 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe Int16 actualResult = default; Int16 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Int16 pairResult = default; + + pairResult += (Int16)(left[i + 0] * right[i + 0]); + pairResult += (Int16)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Int16)(left[i] * right[i]); + } + else + { + intermResult += (Int16)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs index 953acc6a04eec7..873c3b37e0c6f4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs @@ -296,14 +296,27 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe Int32 actualResult = default; Int32 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Int32 pairResult = default; + + pairResult += (Int32)(left[i + 0] * right[i + 0]); + pairResult += (Int32)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Int32)(left[i] * right[i]); + } + else + { + intermResult += (Int32)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs index 2271a66d11e442..d63f96c912299b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs @@ -296,14 +296,27 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe Int64 actualResult = default; Int64 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Int64 pairResult = default; + + pairResult += (Int64)(left[i + 0] * right[i + 0]); + pairResult += (Int64)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Int64)(left[i] * right[i]); + } + else + { + intermResult += (Int64)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs index 465a800b43bd5c..860030ea9f2e5a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs @@ -296,14 +296,27 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe SByte actualResult = default; SByte intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + SByte pairResult = default; + + pairResult += (SByte)(left[i + 0] * right[i + 0]); + pairResult += (SByte)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (SByte)(left[i] * right[i]); + } + else + { + intermResult += (SByte)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs index 02608cb7a0988d..30ad0e60ff35db 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs @@ -296,14 +296,27 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle Single actualResult = default; Single intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Single pairResult = default; + + pairResult += (Single)(left[i + 0] * right[i + 0]); + pairResult += (Single)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Single)(left[i] * right[i]); + } + else + { + intermResult += (Single)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs index 0b01ba2fc7c869..f9bc2f58ff8df1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs @@ -296,14 +296,27 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle UInt16 actualResult = default; UInt16 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + UInt16 pairResult = default; + + pairResult += (UInt16)(left[i + 0] * right[i + 0]); + pairResult += (UInt16)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (UInt16)(left[i] * right[i]); + } + else + { + intermResult += (UInt16)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs index 801545dc3e9f31..2cd02a2bd6511b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs @@ -296,14 +296,27 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle UInt32 actualResult = default; UInt32 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + UInt32 pairResult = default; + + pairResult += (UInt32)(left[i + 0] * right[i + 0]); + pairResult += (UInt32)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (UInt32)(left[i] * right[i]); + } + else + { + intermResult += (UInt32)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs index e45936decd417e..dc66cdc48623d3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs @@ -296,14 +296,27 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle UInt64 actualResult = default; UInt64 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + UInt64 pairResult = default; + + pairResult += (UInt64)(left[i + 0] * right[i + 0]); + pairResult += (UInt64)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (UInt64)(left[i] * right[i]); + } + else + { + intermResult += (UInt64)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs index 6df5f319399bc1..942578a4c09c69 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs @@ -296,14 +296,27 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe Byte actualResult = default; Byte intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Byte pairResult = default; + + pairResult += (Byte)(left[i + 0] * right[i + 0]); + pairResult += (Byte)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Byte)(left[i] * right[i]); + } + else + { + intermResult += (Byte)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs index a31b46968163e8..845cc0a34d707d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs @@ -296,14 +296,27 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle Double actualResult = default; Double intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Double pairResult = default; + + pairResult += (Double)(left[i + 0] * right[i + 0]); + pairResult += (Double)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Double)(left[i] * right[i]); + } + else + { + intermResult += (Double)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs index 0c3d493127c8d2..9105289413ed7f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs @@ -296,14 +296,27 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe Int16 actualResult = default; Int16 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Int16 pairResult = default; + + pairResult += (Int16)(left[i + 0] * right[i + 0]); + pairResult += (Int16)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Int16)(left[i] * right[i]); + } + else + { + intermResult += (Int16)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs index 34a241f404e681..3f5fc6f7e7ecfc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs @@ -296,14 +296,27 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe Int32 actualResult = default; Int32 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Int32 pairResult = default; + + pairResult += (Int32)(left[i + 0] * right[i + 0]); + pairResult += (Int32)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Int32)(left[i] * right[i]); + } + else + { + intermResult += (Int32)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs index 237d3cbf08ba49..7663797a501c54 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs @@ -296,14 +296,27 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe Int64 actualResult = default; Int64 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Int64 pairResult = default; + + pairResult += (Int64)(left[i + 0] * right[i + 0]); + pairResult += (Int64)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Int64)(left[i] * right[i]); + } + else + { + intermResult += (Int64)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs index 7fcc9e2df39cd5..96611e02809873 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs @@ -296,14 +296,27 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe SByte actualResult = default; SByte intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + SByte pairResult = default; + + pairResult += (SByte)(left[i + 0] * right[i + 0]); + pairResult += (SByte)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (SByte)(left[i] * right[i]); + } + else + { + intermResult += (SByte)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs index 045f3c08f24463..c6860f679a5c74 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs @@ -296,14 +296,27 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle Single actualResult = default; Single intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Single pairResult = default; + + pairResult += (Single)(left[i + 0] * right[i + 0]); + pairResult += (Single)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Single)(left[i] * right[i]); + } + else + { + intermResult += (Single)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs index 777fc0ce0f486f..c1fec869f6c10a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs @@ -296,14 +296,27 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle UInt16 actualResult = default; UInt16 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + UInt16 pairResult = default; + + pairResult += (UInt16)(left[i + 0] * right[i + 0]); + pairResult += (UInt16)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (UInt16)(left[i] * right[i]); + } + else + { + intermResult += (UInt16)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs index 9363faea093190..bbbf14a41ac475 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs @@ -296,14 +296,27 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle UInt32 actualResult = default; UInt32 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + UInt32 pairResult = default; + + pairResult += (UInt32)(left[i + 0] * right[i + 0]); + pairResult += (UInt32)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (UInt32)(left[i] * right[i]); + } + else + { + intermResult += (UInt32)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs index b01e24d8b3d7a4..9c32b7f8bd6a6a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs @@ -296,14 +296,27 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle UInt64 actualResult = default; UInt64 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + UInt64 pairResult = default; + + pairResult += (UInt64)(left[i + 0] * right[i + 0]); + pairResult += (UInt64)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (UInt64)(left[i] * right[i]); + } + else + { + intermResult += (UInt64)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs index efb6d47461fe3f..25a03f65b3416a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs @@ -296,14 +296,27 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe Byte actualResult = default; Byte intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Byte pairResult = default; + + pairResult += (Byte)(left[i + 0] * right[i + 0]); + pairResult += (Byte)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Byte)(left[i] * right[i]); + } + else + { + intermResult += (Byte)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs index 0e2add0dfbd21d..bfd8456533fdef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs @@ -296,14 +296,27 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle Double actualResult = default; Double intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Double pairResult = default; + + pairResult += (Double)(left[i + 0] * right[i + 0]); + pairResult += (Double)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Double)(left[i] * right[i]); + } + else + { + intermResult += (Double)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs index 00360c20a93318..ca4e3646554074 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs @@ -296,14 +296,27 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe Int16 actualResult = default; Int16 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Int16 pairResult = default; + + pairResult += (Int16)(left[i + 0] * right[i + 0]); + pairResult += (Int16)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Int16)(left[i] * right[i]); + } + else + { + intermResult += (Int16)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs index 538d4153725d30..2ed60d5cb32d9b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs @@ -296,14 +296,27 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe Int32 actualResult = default; Int32 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Int32 pairResult = default; + + pairResult += (Int32)(left[i + 0] * right[i + 0]); + pairResult += (Int32)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Int32)(left[i] * right[i]); + } + else + { + intermResult += (Int32)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs index 8448990c6c22c5..62ccc561dd911f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs @@ -296,14 +296,27 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe Int64 actualResult = default; Int64 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Int64 pairResult = default; + + pairResult += (Int64)(left[i + 0] * right[i + 0]); + pairResult += (Int64)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Int64)(left[i] * right[i]); + } + else + { + intermResult += (Int64)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs index e759c6558d5245..5e3c5acbe0cf71 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs @@ -296,14 +296,27 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe SByte actualResult = default; SByte intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + SByte pairResult = default; + + pairResult += (SByte)(left[i + 0] * right[i + 0]); + pairResult += (SByte)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (SByte)(left[i] * right[i]); + } + else + { + intermResult += (SByte)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs index b0dba78909a35d..eb1c9b12d428a9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs @@ -296,14 +296,27 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle Single actualResult = default; Single intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Single pairResult = default; + + pairResult += (Single)(left[i + 0] * right[i + 0]); + pairResult += (Single)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Single)(left[i] * right[i]); + } + else + { + intermResult += (Single)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs index 4301c4be3688f8..763bd44385be83 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs @@ -296,14 +296,27 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle UInt16 actualResult = default; UInt16 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + UInt16 pairResult = default; + + pairResult += (UInt16)(left[i + 0] * right[i + 0]); + pairResult += (UInt16)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (UInt16)(left[i] * right[i]); + } + else + { + intermResult += (UInt16)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs index 757df362f21a96..fd95333599ddec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs @@ -296,14 +296,27 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle UInt32 actualResult = default; UInt32 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + UInt32 pairResult = default; + + pairResult += (UInt32)(left[i + 0] * right[i + 0]); + pairResult += (UInt32)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (UInt32)(left[i] * right[i]); + } + else + { + intermResult += (UInt32)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs index 3f693bd3419fc2..98cf36821686d7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs @@ -296,14 +296,27 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle UInt64 actualResult = default; UInt64 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + UInt64 pairResult = default; + + pairResult += (UInt64)(left[i + 0] * right[i + 0]); + pairResult += (UInt64)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (UInt64)(left[i] * right[i]); + } + else + { + intermResult += (UInt64)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs index c6dca2efa7508d..a39decfd9b29aa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs @@ -296,14 +296,27 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe Byte actualResult = default; Byte intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Byte pairResult = default; + + pairResult += (Byte)(left[i + 0] * right[i + 0]); + pairResult += (Byte)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Byte)(left[i] * right[i]); + } + else + { + intermResult += (Byte)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs index cc33be50181db4..68af76f1594629 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs @@ -296,14 +296,27 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle Double actualResult = default; Double intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Double pairResult = default; + + pairResult += (Double)(left[i + 0] * right[i + 0]); + pairResult += (Double)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Double)(left[i] * right[i]); + } + else + { + intermResult += (Double)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs index e7b6a5b22fbb2a..eb61f344d9afe6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs @@ -296,14 +296,27 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe Int16 actualResult = default; Int16 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Int16 pairResult = default; + + pairResult += (Int16)(left[i + 0] * right[i + 0]); + pairResult += (Int16)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Int16)(left[i] * right[i]); + } + else + { + intermResult += (Int16)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs index d318880a582983..5a362c920c411e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs @@ -296,14 +296,27 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe Int32 actualResult = default; Int32 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Int32 pairResult = default; + + pairResult += (Int32)(left[i + 0] * right[i + 0]); + pairResult += (Int32)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Int32)(left[i] * right[i]); + } + else + { + intermResult += (Int32)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs index 9c4951860a5d97..5db4170d8cd88a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs @@ -296,14 +296,27 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe Int64 actualResult = default; Int64 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Int64 pairResult = default; + + pairResult += (Int64)(left[i + 0] * right[i + 0]); + pairResult += (Int64)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Int64)(left[i] * right[i]); + } + else + { + intermResult += (Int64)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs index 40af3cc2c5bc30..bb99bb899103ee 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs @@ -296,14 +296,27 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe SByte actualResult = default; SByte intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + SByte pairResult = default; + + pairResult += (SByte)(left[i + 0] * right[i + 0]); + pairResult += (SByte)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (SByte)(left[i] * right[i]); + } + else + { + intermResult += (SByte)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs index 72e3641dda7da5..b1e5c9b50bb194 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs @@ -296,14 +296,27 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle Single actualResult = default; Single intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + Single pairResult = default; + + pairResult += (Single)(left[i + 0] * right[i + 0]); + pairResult += (Single)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (Single)(left[i] * right[i]); + } + else + { + intermResult += (Single)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs index ab0d388a277367..26f5871412809a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs @@ -296,14 +296,27 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle UInt16 actualResult = default; UInt16 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + UInt16 pairResult = default; + + pairResult += (UInt16)(left[i + 0] * right[i + 0]); + pairResult += (UInt16)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (UInt16)(left[i] * right[i]); + } + else + { + intermResult += (UInt16)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs index 01953a6fb31fa1..ef440b3bee72e8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs @@ -296,14 +296,27 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle UInt32 actualResult = default; UInt32 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + UInt32 pairResult = default; + + pairResult += (UInt32)(left[i + 0] * right[i + 0]); + pairResult += (UInt32)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (UInt32)(left[i] * right[i]); + } + else + { + intermResult += (UInt32)(left[0] * right[0]); } actualResult += intermResult; diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs index 4705c52a5774b2..c143b4d40c5cb9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs @@ -296,14 +296,27 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle UInt64 actualResult = default; UInt64 intermResult = default; - for (var i = 0; i < Op1ElementCount; i++) + if (Op1ElementCount != 1) { - if ((i % Vector128.Count) == 0) + for (var i = 0; i < Op1ElementCount; i += 2) { - actualResult += intermResult; - intermResult = default; + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + + UInt64 pairResult = default; + + pairResult += (UInt64)(left[i + 0] * right[i + 0]); + pairResult += (UInt64)(left[i + 1] * right[i + 1]); + + intermResult += pairResult; } - intermResult += (UInt64)(left[i] * right[i]); + } + else + { + intermResult += (UInt64)(left[0] * right[0]); } actualResult += intermResult; From 783bb1f9d47fdd95d70dd9d064f95e0d93123de3 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Mon, 14 Nov 2022 07:43:03 -0800 Subject: [PATCH 12/26] Ensure the Dot test computes the result pairs correctly --- .../Regression/GitHub_75791/GitHub_75791.cs | 5 ++ .../General/Shared/VectorDotTest.template | 53 +++++++++---------- .../General/Vector128/Dot.Byte.cs | 53 +++++++++---------- .../General/Vector128/Dot.Double.cs | 53 +++++++++---------- .../General/Vector128/Dot.Int16.cs | 53 +++++++++---------- .../General/Vector128/Dot.Int32.cs | 53 +++++++++---------- .../General/Vector128/Dot.Int64.cs | 53 +++++++++---------- .../General/Vector128/Dot.SByte.cs | 53 +++++++++---------- .../General/Vector128/Dot.Single.cs | 53 +++++++++---------- .../General/Vector128/Dot.UInt16.cs | 53 +++++++++---------- .../General/Vector128/Dot.UInt32.cs | 53 +++++++++---------- .../General/Vector128/Dot.UInt64.cs | 53 +++++++++---------- .../General/Vector256/Dot.Byte.cs | 53 +++++++++---------- .../General/Vector256/Dot.Double.cs | 53 +++++++++---------- .../General/Vector256/Dot.Int16.cs | 53 +++++++++---------- .../General/Vector256/Dot.Int32.cs | 53 +++++++++---------- .../General/Vector256/Dot.Int64.cs | 53 +++++++++---------- .../General/Vector256/Dot.SByte.cs | 53 +++++++++---------- .../General/Vector256/Dot.Single.cs | 53 +++++++++---------- .../General/Vector256/Dot.UInt16.cs | 53 +++++++++---------- .../General/Vector256/Dot.UInt32.cs | 53 +++++++++---------- .../General/Vector256/Dot.UInt64.cs | 53 +++++++++---------- .../General/Vector512/Dot.Byte.cs | 53 +++++++++---------- .../General/Vector512/Dot.Double.cs | 53 +++++++++---------- .../General/Vector512/Dot.Int16.cs | 53 +++++++++---------- .../General/Vector512/Dot.Int32.cs | 53 +++++++++---------- .../General/Vector512/Dot.Int64.cs | 53 +++++++++---------- .../General/Vector512/Dot.SByte.cs | 53 +++++++++---------- .../General/Vector512/Dot.Single.cs | 53 +++++++++---------- .../General/Vector512/Dot.UInt16.cs | 53 +++++++++---------- .../General/Vector512/Dot.UInt32.cs | 53 +++++++++---------- .../General/Vector512/Dot.UInt64.cs | 53 +++++++++---------- .../General/Vector64/Dot.Byte.cs | 53 +++++++++---------- .../General/Vector64/Dot.Double.cs | 53 +++++++++---------- .../General/Vector64/Dot.Int16.cs | 53 +++++++++---------- .../General/Vector64/Dot.Int32.cs | 53 +++++++++---------- .../General/Vector64/Dot.Int64.cs | 53 +++++++++---------- .../General/Vector64/Dot.SByte.cs | 53 +++++++++---------- .../General/Vector64/Dot.Single.cs | 53 +++++++++---------- .../General/Vector64/Dot.UInt16.cs | 53 +++++++++---------- .../General/Vector64/Dot.UInt32.cs | 53 +++++++++---------- .../General/Vector64/Dot.UInt64.cs | 53 +++++++++---------- 42 files changed, 1071 insertions(+), 1107 deletions(-) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Regression/GitHub_75791/GitHub_75791.cs b/src/tests/JIT/HardwareIntrinsics/General/Regression/GitHub_75791/GitHub_75791.cs index 65eac2076713e5..a0fcb1caf92a40 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Regression/GitHub_75791/GitHub_75791.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Regression/GitHub_75791/GitHub_75791.cs @@ -22,6 +22,11 @@ public static void TestVector512() Vector512.Create(0.9997464f, 0.3368471f, 0.4043606f, 0.40446985f, 0.8205302f, 0.96234834f, 0.033238932f, 0.4785298f, 0.5980946f, 0.035252146f, 0.466319f, 0.48365256f, 0.95094615f, 0.76286495f, 0.058176957f, 0.044761457f), Vector512.Create(0.192693f, 0.65009266f, 0.73478293f, 0.45294976f, 0.32503143f, 0.096156664f, 0.20120476f, 0.09926898f, 0.4980145f, 0.89575404f, 0.700502f, 0.92765516f, 0.06838739f, 0.7633024f, 0.5538336f, 0.83792007f) )); + + Assert.Equal(5.161698f, Vector512.Dot( + Vector512.Create(0.024523573f, 0.9157307f, 0.81342965f, 0.975703f, 0.7373163f, 0.17368627f, 0.78028226f, 0.5694267f, 0.06921448f, 0.5432087f, 0.69687283f, 0.96234965f, 0.5256825f, 0.49651694f, 0.969829f, 0.3919952f), + Vector512.Create(0.90546f, 0.61288774f, 0.12319762f, 0.6599227f, 0.18527496f, 0.28016788f, 0.4850578f, 0.5630629f, 0.8017178f, 0.7248057f, 0.6808885f, 0.35055026f, 0.740812f, 0.5224796f, 0.6798979f, 0.97064143f) + )); } [Fact] diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorDotTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorDotTest.template index 1da96e45b01465..92ebb74d2a9b7c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorDotTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorDotTest.template @@ -293,33 +293,7 @@ namespace JIT.HardwareIntrinsics.General { bool succeeded = true; - {RetBaseType} actualResult = default; - {RetBaseType} intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128<{Op1BaseType}>.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - {RetBaseType} pairResult = default; - - pairResult += ({RetBaseType})(left[i + 0] * right[i + 0]); - pairResult += ({RetBaseType})(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += ({RetBaseType})(left[0] * right[0]); - } - - actualResult += intermResult; + {RetBaseType} actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ namespace JIT.HardwareIntrinsics.General Succeeded = false; } } + + private {RetBaseType} ComputeExpectedResult(ReadOnlySpan<{Op1BaseType}> left, ReadOnlySpan<{Op2BaseType}> right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return ({RetBaseType})( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return ({RetBaseType})(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs index e02de75484e93b..a765323977054e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs @@ -293,33 +293,7 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe { bool succeeded = true; - Byte actualResult = default; - Byte intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Byte pairResult = default; - - pairResult += (Byte)(left[i + 0] * right[i + 0]); - pairResult += (Byte)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Byte)(left[0] * right[0]); - } - - actualResult += intermResult; + Byte actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe Succeeded = false; } } + + private Byte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Byte)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Byte)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs index d11ab76ada9558..31356baab6ba99 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs @@ -293,33 +293,7 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle { bool succeeded = true; - Double actualResult = default; - Double intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Double pairResult = default; - - pairResult += (Double)(left[i + 0] * right[i + 0]); - pairResult += (Double)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Double)(left[0] * right[0]); - } - - actualResult += intermResult; + Double actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle Succeeded = false; } } + + private Double ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Double)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Double)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs index ca0d3ef920f34f..0132ee2f901b4f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs @@ -293,33 +293,7 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe { bool succeeded = true; - Int16 actualResult = default; - Int16 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Int16 pairResult = default; - - pairResult += (Int16)(left[i + 0] * right[i + 0]); - pairResult += (Int16)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Int16)(left[0] * right[0]); - } - - actualResult += intermResult; + Int16 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe Succeeded = false; } } + + private Int16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int16)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int16)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs index 873c3b37e0c6f4..2f82c523040b8e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs @@ -293,33 +293,7 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe { bool succeeded = true; - Int32 actualResult = default; - Int32 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Int32 pairResult = default; - - pairResult += (Int32)(left[i + 0] * right[i + 0]); - pairResult += (Int32)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Int32)(left[0] * right[0]); - } - - actualResult += intermResult; + Int32 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe Succeeded = false; } } + + private Int32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int32)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int32)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs index d63f96c912299b..fdd55bfdcfe65e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs @@ -293,33 +293,7 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe { bool succeeded = true; - Int64 actualResult = default; - Int64 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Int64 pairResult = default; - - pairResult += (Int64)(left[i + 0] * right[i + 0]); - pairResult += (Int64)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Int64)(left[0] * right[0]); - } - - actualResult += intermResult; + Int64 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe Succeeded = false; } } + + private Int64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int64)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int64)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs index 860030ea9f2e5a..223eeec93e8210 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs @@ -293,33 +293,7 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe { bool succeeded = true; - SByte actualResult = default; - SByte intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - SByte pairResult = default; - - pairResult += (SByte)(left[i + 0] * right[i + 0]); - pairResult += (SByte)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (SByte)(left[0] * right[0]); - } - - actualResult += intermResult; + SByte actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe Succeeded = false; } } + + private SByte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (SByte)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (SByte)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs index 30ad0e60ff35db..29cd69cd575c55 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs @@ -293,33 +293,7 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle { bool succeeded = true; - Single actualResult = default; - Single intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Single pairResult = default; - - pairResult += (Single)(left[i + 0] * right[i + 0]); - pairResult += (Single)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Single)(left[0] * right[0]); - } - - actualResult += intermResult; + Single actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle Succeeded = false; } } + + private Single ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Single)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Single)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs index f9bc2f58ff8df1..3a6c3a87e83112 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs @@ -293,33 +293,7 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle { bool succeeded = true; - UInt16 actualResult = default; - UInt16 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - UInt16 pairResult = default; - - pairResult += (UInt16)(left[i + 0] * right[i + 0]); - pairResult += (UInt16)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (UInt16)(left[0] * right[0]); - } - - actualResult += intermResult; + UInt16 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle Succeeded = false; } } + + private UInt16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt16)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt16)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs index 2cd02a2bd6511b..bf96150f4c1460 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs @@ -293,33 +293,7 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle { bool succeeded = true; - UInt32 actualResult = default; - UInt32 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - UInt32 pairResult = default; - - pairResult += (UInt32)(left[i + 0] * right[i + 0]); - pairResult += (UInt32)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (UInt32)(left[0] * right[0]); - } - - actualResult += intermResult; + UInt32 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle Succeeded = false; } } + + private UInt32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt32)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt32)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs index dc66cdc48623d3..37e88f6e158cc4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs @@ -293,33 +293,7 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle { bool succeeded = true; - UInt64 actualResult = default; - UInt64 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - UInt64 pairResult = default; - - pairResult += (UInt64)(left[i + 0] * right[i + 0]); - pairResult += (UInt64)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (UInt64)(left[0] * right[0]); - } - - actualResult += intermResult; + UInt64 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle Succeeded = false; } } + + private UInt64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt64)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt64)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs index 942578a4c09c69..088ca272e81cd6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs @@ -293,33 +293,7 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe { bool succeeded = true; - Byte actualResult = default; - Byte intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Byte pairResult = default; - - pairResult += (Byte)(left[i + 0] * right[i + 0]); - pairResult += (Byte)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Byte)(left[0] * right[0]); - } - - actualResult += intermResult; + Byte actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe Succeeded = false; } } + + private Byte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Byte)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Byte)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs index 845cc0a34d707d..40c543e620b9e5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs @@ -293,33 +293,7 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle { bool succeeded = true; - Double actualResult = default; - Double intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Double pairResult = default; - - pairResult += (Double)(left[i + 0] * right[i + 0]); - pairResult += (Double)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Double)(left[0] * right[0]); - } - - actualResult += intermResult; + Double actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle Succeeded = false; } } + + private Double ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Double)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Double)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs index 9105289413ed7f..1134392b46a426 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs @@ -293,33 +293,7 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe { bool succeeded = true; - Int16 actualResult = default; - Int16 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Int16 pairResult = default; - - pairResult += (Int16)(left[i + 0] * right[i + 0]); - pairResult += (Int16)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Int16)(left[0] * right[0]); - } - - actualResult += intermResult; + Int16 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe Succeeded = false; } } + + private Int16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int16)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int16)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs index 3f5fc6f7e7ecfc..9f237d402c1ef3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs @@ -293,33 +293,7 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe { bool succeeded = true; - Int32 actualResult = default; - Int32 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Int32 pairResult = default; - - pairResult += (Int32)(left[i + 0] * right[i + 0]); - pairResult += (Int32)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Int32)(left[0] * right[0]); - } - - actualResult += intermResult; + Int32 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe Succeeded = false; } } + + private Int32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int32)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int32)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs index 7663797a501c54..b9166be7fc30a7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs @@ -293,33 +293,7 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe { bool succeeded = true; - Int64 actualResult = default; - Int64 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Int64 pairResult = default; - - pairResult += (Int64)(left[i + 0] * right[i + 0]); - pairResult += (Int64)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Int64)(left[0] * right[0]); - } - - actualResult += intermResult; + Int64 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe Succeeded = false; } } + + private Int64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int64)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int64)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs index 96611e02809873..7aebe23f0c1059 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs @@ -293,33 +293,7 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe { bool succeeded = true; - SByte actualResult = default; - SByte intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - SByte pairResult = default; - - pairResult += (SByte)(left[i + 0] * right[i + 0]); - pairResult += (SByte)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (SByte)(left[0] * right[0]); - } - - actualResult += intermResult; + SByte actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe Succeeded = false; } } + + private SByte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (SByte)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (SByte)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs index c6860f679a5c74..187febd4bbf5cb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs @@ -293,33 +293,7 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle { bool succeeded = true; - Single actualResult = default; - Single intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Single pairResult = default; - - pairResult += (Single)(left[i + 0] * right[i + 0]); - pairResult += (Single)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Single)(left[0] * right[0]); - } - - actualResult += intermResult; + Single actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle Succeeded = false; } } + + private Single ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Single)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Single)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs index c1fec869f6c10a..87df544bea5abb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs @@ -293,33 +293,7 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle { bool succeeded = true; - UInt16 actualResult = default; - UInt16 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - UInt16 pairResult = default; - - pairResult += (UInt16)(left[i + 0] * right[i + 0]); - pairResult += (UInt16)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (UInt16)(left[0] * right[0]); - } - - actualResult += intermResult; + UInt16 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle Succeeded = false; } } + + private UInt16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt16)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt16)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs index bbbf14a41ac475..98b830c11778cc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs @@ -293,33 +293,7 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle { bool succeeded = true; - UInt32 actualResult = default; - UInt32 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - UInt32 pairResult = default; - - pairResult += (UInt32)(left[i + 0] * right[i + 0]); - pairResult += (UInt32)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (UInt32)(left[0] * right[0]); - } - - actualResult += intermResult; + UInt32 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle Succeeded = false; } } + + private UInt32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt32)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt32)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs index 9c32b7f8bd6a6a..505b2905102904 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs @@ -293,33 +293,7 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle { bool succeeded = true; - UInt64 actualResult = default; - UInt64 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - UInt64 pairResult = default; - - pairResult += (UInt64)(left[i + 0] * right[i + 0]); - pairResult += (UInt64)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (UInt64)(left[0] * right[0]); - } - - actualResult += intermResult; + UInt64 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle Succeeded = false; } } + + private UInt64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt64)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt64)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs index 25a03f65b3416a..c2cb61d0e87b27 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs @@ -293,33 +293,7 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe { bool succeeded = true; - Byte actualResult = default; - Byte intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Byte pairResult = default; - - pairResult += (Byte)(left[i + 0] * right[i + 0]); - pairResult += (Byte)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Byte)(left[0] * right[0]); - } - - actualResult += intermResult; + Byte actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe Succeeded = false; } } + + private Byte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Byte)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Byte)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs index bfd8456533fdef..c8ae4ab88b5d38 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs @@ -293,33 +293,7 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle { bool succeeded = true; - Double actualResult = default; - Double intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Double pairResult = default; - - pairResult += (Double)(left[i + 0] * right[i + 0]); - pairResult += (Double)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Double)(left[0] * right[0]); - } - - actualResult += intermResult; + Double actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle Succeeded = false; } } + + private Double ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Double)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Double)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs index ca4e3646554074..2341d2edb67832 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs @@ -293,33 +293,7 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe { bool succeeded = true; - Int16 actualResult = default; - Int16 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Int16 pairResult = default; - - pairResult += (Int16)(left[i + 0] * right[i + 0]); - pairResult += (Int16)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Int16)(left[0] * right[0]); - } - - actualResult += intermResult; + Int16 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe Succeeded = false; } } + + private Int16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int16)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int16)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs index 2ed60d5cb32d9b..0bd28b993e9f13 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs @@ -293,33 +293,7 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe { bool succeeded = true; - Int32 actualResult = default; - Int32 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Int32 pairResult = default; - - pairResult += (Int32)(left[i + 0] * right[i + 0]); - pairResult += (Int32)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Int32)(left[0] * right[0]); - } - - actualResult += intermResult; + Int32 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe Succeeded = false; } } + + private Int32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int32)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int32)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs index 62ccc561dd911f..2352b6db132b87 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs @@ -293,33 +293,7 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe { bool succeeded = true; - Int64 actualResult = default; - Int64 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Int64 pairResult = default; - - pairResult += (Int64)(left[i + 0] * right[i + 0]); - pairResult += (Int64)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Int64)(left[0] * right[0]); - } - - actualResult += intermResult; + Int64 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe Succeeded = false; } } + + private Int64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int64)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int64)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs index 5e3c5acbe0cf71..fd38aba7d8f2fe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs @@ -293,33 +293,7 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe { bool succeeded = true; - SByte actualResult = default; - SByte intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - SByte pairResult = default; - - pairResult += (SByte)(left[i + 0] * right[i + 0]); - pairResult += (SByte)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (SByte)(left[0] * right[0]); - } - - actualResult += intermResult; + SByte actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe Succeeded = false; } } + + private SByte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (SByte)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (SByte)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs index eb1c9b12d428a9..9808fde0a145a1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs @@ -293,33 +293,7 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle { bool succeeded = true; - Single actualResult = default; - Single intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Single pairResult = default; - - pairResult += (Single)(left[i + 0] * right[i + 0]); - pairResult += (Single)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Single)(left[0] * right[0]); - } - - actualResult += intermResult; + Single actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle Succeeded = false; } } + + private Single ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Single)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Single)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs index 763bd44385be83..824ea0b9a64e7f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs @@ -293,33 +293,7 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle { bool succeeded = true; - UInt16 actualResult = default; - UInt16 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - UInt16 pairResult = default; - - pairResult += (UInt16)(left[i + 0] * right[i + 0]); - pairResult += (UInt16)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (UInt16)(left[0] * right[0]); - } - - actualResult += intermResult; + UInt16 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle Succeeded = false; } } + + private UInt16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt16)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt16)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs index fd95333599ddec..bf3d0ab7053649 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs @@ -293,33 +293,7 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle { bool succeeded = true; - UInt32 actualResult = default; - UInt32 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - UInt32 pairResult = default; - - pairResult += (UInt32)(left[i + 0] * right[i + 0]); - pairResult += (UInt32)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (UInt32)(left[0] * right[0]); - } - - actualResult += intermResult; + UInt32 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle Succeeded = false; } } + + private UInt32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt32)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt32)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs index 98cf36821686d7..49b27f6f590723 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs @@ -293,33 +293,7 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle { bool succeeded = true; - UInt64 actualResult = default; - UInt64 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - UInt64 pairResult = default; - - pairResult += (UInt64)(left[i + 0] * right[i + 0]); - pairResult += (UInt64)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (UInt64)(left[0] * right[0]); - } - - actualResult += intermResult; + UInt64 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle Succeeded = false; } } + + private UInt64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt64)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt64)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs index a39decfd9b29aa..21d31bebc0fbd9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs @@ -293,33 +293,7 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe { bool succeeded = true; - Byte actualResult = default; - Byte intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Byte pairResult = default; - - pairResult += (Byte)(left[i + 0] * right[i + 0]); - pairResult += (Byte)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Byte)(left[0] * right[0]); - } - - actualResult += intermResult; + Byte actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe Succeeded = false; } } + + private Byte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Byte)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Byte)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs index 68af76f1594629..3111a10fd982d5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs @@ -293,33 +293,7 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle { bool succeeded = true; - Double actualResult = default; - Double intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Double pairResult = default; - - pairResult += (Double)(left[i + 0] * right[i + 0]); - pairResult += (Double)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Double)(left[0] * right[0]); - } - - actualResult += intermResult; + Double actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle Succeeded = false; } } + + private Double ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Double)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Double)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs index eb61f344d9afe6..527af4c857b292 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs @@ -293,33 +293,7 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe { bool succeeded = true; - Int16 actualResult = default; - Int16 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Int16 pairResult = default; - - pairResult += (Int16)(left[i + 0] * right[i + 0]); - pairResult += (Int16)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Int16)(left[0] * right[0]); - } - - actualResult += intermResult; + Int16 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe Succeeded = false; } } + + private Int16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int16)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int16)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs index 5a362c920c411e..ea16da18278aaf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs @@ -293,33 +293,7 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe { bool succeeded = true; - Int32 actualResult = default; - Int32 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Int32 pairResult = default; - - pairResult += (Int32)(left[i + 0] * right[i + 0]); - pairResult += (Int32)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Int32)(left[0] * right[0]); - } - - actualResult += intermResult; + Int32 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe Succeeded = false; } } + + private Int32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int32)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int32)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs index 5db4170d8cd88a..32c93a93cd09a5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs @@ -293,33 +293,7 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe { bool succeeded = true; - Int64 actualResult = default; - Int64 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Int64 pairResult = default; - - pairResult += (Int64)(left[i + 0] * right[i + 0]); - pairResult += (Int64)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Int64)(left[0] * right[0]); - } - - actualResult += intermResult; + Int64 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe Succeeded = false; } } + + private Int64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int64)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int64)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs index bb99bb899103ee..165dfa059e0dd9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs @@ -293,33 +293,7 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe { bool succeeded = true; - SByte actualResult = default; - SByte intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - SByte pairResult = default; - - pairResult += (SByte)(left[i + 0] * right[i + 0]); - pairResult += (SByte)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (SByte)(left[0] * right[0]); - } - - actualResult += intermResult; + SByte actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe Succeeded = false; } } + + private SByte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (SByte)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (SByte)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs index b1e5c9b50bb194..6897729d04c95d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs @@ -293,33 +293,7 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle { bool succeeded = true; - Single actualResult = default; - Single intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - Single pairResult = default; - - pairResult += (Single)(left[i + 0] * right[i + 0]); - pairResult += (Single)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (Single)(left[0] * right[0]); - } - - actualResult += intermResult; + Single actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle Succeeded = false; } } + + private Single ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Single)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Single)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs index 26f5871412809a..26e4a085e62e20 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs @@ -293,33 +293,7 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle { bool succeeded = true; - UInt16 actualResult = default; - UInt16 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - UInt16 pairResult = default; - - pairResult += (UInt16)(left[i + 0] * right[i + 0]); - pairResult += (UInt16)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (UInt16)(left[0] * right[0]); - } - - actualResult += intermResult; + UInt16 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle Succeeded = false; } } + + private UInt16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt16)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt16)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs index ef440b3bee72e8..a3d47fb634a2f2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs @@ -293,33 +293,7 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle { bool succeeded = true; - UInt32 actualResult = default; - UInt32 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - UInt32 pairResult = default; - - pairResult += (UInt32)(left[i + 0] * right[i + 0]); - pairResult += (UInt32)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (UInt32)(left[0] * right[0]); - } - - actualResult += intermResult; + UInt32 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle Succeeded = false; } } + + private UInt32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt32)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt32)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs index c143b4d40c5cb9..370de38b1c69d6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs @@ -293,33 +293,7 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle { bool succeeded = true; - UInt64 actualResult = default; - UInt64 intermResult = default; - - if (Op1ElementCount != 1) - { - for (var i = 0; i < Op1ElementCount; i += 2) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - - UInt64 pairResult = default; - - pairResult += (UInt64)(left[i + 0] * right[i + 0]); - pairResult += (UInt64)(left[i + 1] * right[i + 1]); - - intermResult += pairResult; - } - } - else - { - intermResult += (UInt64)(left[0] * right[0]); - } - - actualResult += intermResult; + UInt64 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -337,5 +311,30 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle Succeeded = false; } } + + private UInt64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt64)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt64)(left[0] * right[0]); + } + } } } From ab3afe9bc1194dd79ed5374461f83e833b9a83a3 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Wed, 16 Nov 2022 08:40:03 -0800 Subject: [PATCH 13/26] Simplify the alignment check to avoid future churn --- .../General/Shared/VectorBinaryOpTest.template | 2 +- .../General/Shared/VectorBinaryOperatorTest.template | 2 +- .../General/Shared/VectorBooleanAllBinaryOpTest.template | 2 +- .../General/Shared/VectorBooleanAllBinaryOperatorTest.template | 2 +- .../General/Shared/VectorBooleanAnyBinaryOpTest.template | 2 +- .../General/Shared/VectorBooleanAnyBinaryOperatorTest.template | 2 +- .../General/Shared/VectorConvertToTest.template | 2 +- .../HardwareIntrinsics/General/Shared/VectorDotTest.template | 2 +- .../HardwareIntrinsics/General/Shared/VectorNarrowTest.template | 2 +- .../General/Shared/VectorTernaryOpTest.template | 2 +- .../General/Shared/VectorUnaryOpTest.template | 2 +- .../General/Shared/VectorUnaryOperatorTest.template | 2 +- .../HardwareIntrinsics/General/Shared/VectorWidenTest.template | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Abs.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Abs.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Abs.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Abs.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Abs.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Add.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Add.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Add.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Add.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Add.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseAnd.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseAnd.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseAnd.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseAnd.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseAnd.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseAnd.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseOr.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseOr.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseOr.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseOr.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/BitwiseOr.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Ceiling.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Ceiling.Single.cs | 2 +- .../General/Vector128/ConditionalSelect.Byte.cs | 2 +- .../General/Vector128/ConditionalSelect.Double.cs | 2 +- .../General/Vector128/ConditionalSelect.Int16.cs | 2 +- .../General/Vector128/ConditionalSelect.Int32.cs | 2 +- .../General/Vector128/ConditionalSelect.Int64.cs | 2 +- .../General/Vector128/ConditionalSelect.SByte.cs | 2 +- .../General/Vector128/ConditionalSelect.Single.cs | 2 +- .../General/Vector128/ConditionalSelect.UInt16.cs | 2 +- .../General/Vector128/ConditionalSelect.UInt32.cs | 2 +- .../General/Vector128/ConditionalSelect.UInt64.cs | 2 +- .../General/Vector128/ConvertToDouble.Int64.cs | 2 +- .../General/Vector128/ConvertToDouble.UInt64.cs | 2 +- .../General/Vector128/ConvertToInt32.Single.cs | 2 +- .../General/Vector128/ConvertToInt64.Double.cs | 2 +- .../General/Vector128/ConvertToSingle.Int32.cs | 2 +- .../General/Vector128/ConvertToSingle.UInt32.cs | 2 +- .../General/Vector128/ConvertToUInt32.Single.cs | 2 +- .../General/Vector128/ConvertToUInt64.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Divide.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Equals.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAll.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAll.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAll.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAll.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAll.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAll.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAny.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/EqualsAny.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAny.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAny.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAny.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/EqualsAny.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Floor.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Floor.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThan.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThanAll.Byte.cs | 2 +- .../General/Vector128/GreaterThanAll.Double.cs | 2 +- .../General/Vector128/GreaterThanAll.Int16.cs | 2 +- .../General/Vector128/GreaterThanAll.Int32.cs | 2 +- .../General/Vector128/GreaterThanAll.Int64.cs | 2 +- .../General/Vector128/GreaterThanAll.SByte.cs | 2 +- .../General/Vector128/GreaterThanAll.Single.cs | 2 +- .../General/Vector128/GreaterThanAll.UInt16.cs | 2 +- .../General/Vector128/GreaterThanAll.UInt32.cs | 2 +- .../General/Vector128/GreaterThanAll.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128/GreaterThanAny.Byte.cs | 2 +- .../General/Vector128/GreaterThanAny.Double.cs | 2 +- .../General/Vector128/GreaterThanAny.Int16.cs | 2 +- .../General/Vector128/GreaterThanAny.Int32.cs | 2 +- .../General/Vector128/GreaterThanAny.Int64.cs | 2 +- .../General/Vector128/GreaterThanAny.SByte.cs | 2 +- .../General/Vector128/GreaterThanAny.Single.cs | 2 +- .../General/Vector128/GreaterThanAny.UInt16.cs | 2 +- .../General/Vector128/GreaterThanAny.UInt32.cs | 2 +- .../General/Vector128/GreaterThanAny.UInt64.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.Byte.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.Double.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.Int16.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.Int32.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.Int64.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.SByte.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.Single.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.UInt16.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.UInt32.cs | 2 +- .../General/Vector128/GreaterThanOrEqual.UInt64.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.Byte.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.Double.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.Int16.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.Int32.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.Int64.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.SByte.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.Single.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.UInt16.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.UInt32.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAll.UInt64.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.Byte.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.Double.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.Int16.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.Int32.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.Int64.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.SByte.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.Single.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.UInt16.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.UInt32.cs | 2 +- .../General/Vector128/GreaterThanOrEqualAny.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAll.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector128/LessThanAny.UInt64.cs | 2 +- .../General/Vector128/LessThanOrEqual.Byte.cs | 2 +- .../General/Vector128/LessThanOrEqual.Double.cs | 2 +- .../General/Vector128/LessThanOrEqual.Int16.cs | 2 +- .../General/Vector128/LessThanOrEqual.Int32.cs | 2 +- .../General/Vector128/LessThanOrEqual.Int64.cs | 2 +- .../General/Vector128/LessThanOrEqual.SByte.cs | 2 +- .../General/Vector128/LessThanOrEqual.Single.cs | 2 +- .../General/Vector128/LessThanOrEqual.UInt16.cs | 2 +- .../General/Vector128/LessThanOrEqual.UInt32.cs | 2 +- .../General/Vector128/LessThanOrEqual.UInt64.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.Byte.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.Double.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.Int16.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.Int32.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.Int64.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.SByte.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.Single.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.UInt16.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.UInt32.cs | 2 +- .../General/Vector128/LessThanOrEqualAll.UInt64.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.Byte.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.Double.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.Int16.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.Int32.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.Int64.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.SByte.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.Single.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.UInt16.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.UInt32.cs | 2 +- .../General/Vector128/LessThanOrEqualAny.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Max.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Max.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Max.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Max.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Max.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Min.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Min.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Min.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Min.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Min.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Narrow.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Narrow.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Narrow.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Narrow.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Negate.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128/OnesComplement.Byte.cs | 2 +- .../General/Vector128/OnesComplement.Double.cs | 2 +- .../General/Vector128/OnesComplement.Int16.cs | 2 +- .../General/Vector128/OnesComplement.Int32.cs | 2 +- .../General/Vector128/OnesComplement.Int64.cs | 2 +- .../General/Vector128/OnesComplement.SByte.cs | 2 +- .../General/Vector128/OnesComplement.Single.cs | 2 +- .../General/Vector128/OnesComplement.UInt16.cs | 2 +- .../General/Vector128/OnesComplement.UInt32.cs | 2 +- .../General/Vector128/OnesComplement.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Sqrt.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Sqrt.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Sqrt.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Widen.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Widen.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Widen.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Widen.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Widen.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Widen.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Widen.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Xor.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Xor.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Xor.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Xor.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector128/Xor.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Addition.Byte.cs | 2 +- .../General/Vector128_1/op_Addition.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Addition.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Addition.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Addition.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Addition.SByte.cs | 2 +- .../General/Vector128_1/op_Addition.Single.cs | 2 +- .../General/Vector128_1/op_Addition.UInt16.cs | 2 +- .../General/Vector128_1/op_Addition.UInt32.cs | 2 +- .../General/Vector128_1/op_Addition.UInt64.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.Byte.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.Double.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.Int16.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.Int32.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.Int64.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.SByte.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.Single.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.UInt16.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.UInt32.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Byte.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.Double.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.Int16.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.Int32.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.Int64.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.SByte.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.Single.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.UInt16.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.UInt32.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Division.Byte.cs | 2 +- .../General/Vector128_1/op_Division.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Division.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Division.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Division.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Division.SByte.cs | 2 +- .../General/Vector128_1/op_Division.Single.cs | 2 +- .../General/Vector128_1/op_Division.UInt16.cs | 2 +- .../General/Vector128_1/op_Division.UInt32.cs | 2 +- .../General/Vector128_1/op_Division.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Equality.Byte.cs | 2 +- .../General/Vector128_1/op_Equality.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Equality.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Equality.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Equality.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Equality.SByte.cs | 2 +- .../General/Vector128_1/op_Equality.Single.cs | 2 +- .../General/Vector128_1/op_Equality.UInt16.cs | 2 +- .../General/Vector128_1/op_Equality.UInt32.cs | 2 +- .../General/Vector128_1/op_Equality.UInt64.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.Byte.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.Double.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.Int16.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.Int32.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.Int64.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.SByte.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.Single.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.UInt16.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.UInt32.cs | 2 +- .../General/Vector128_1/op_ExclusiveOr.UInt64.cs | 2 +- .../General/Vector128_1/op_Inequality.Byte.cs | 2 +- .../General/Vector128_1/op_Inequality.Double.cs | 2 +- .../General/Vector128_1/op_Inequality.Int16.cs | 2 +- .../General/Vector128_1/op_Inequality.Int32.cs | 2 +- .../General/Vector128_1/op_Inequality.Int64.cs | 2 +- .../General/Vector128_1/op_Inequality.SByte.cs | 2 +- .../General/Vector128_1/op_Inequality.Single.cs | 2 +- .../General/Vector128_1/op_Inequality.UInt16.cs | 2 +- .../General/Vector128_1/op_Inequality.UInt32.cs | 2 +- .../General/Vector128_1/op_Inequality.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Multiply.Byte.cs | 2 +- .../General/Vector128_1/op_Multiply.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Multiply.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Multiply.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Multiply.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_Multiply.SByte.cs | 2 +- .../General/Vector128_1/op_Multiply.Single.cs | 2 +- .../General/Vector128_1/op_Multiply.UInt16.cs | 2 +- .../General/Vector128_1/op_Multiply.UInt32.cs | 2 +- .../General/Vector128_1/op_Multiply.UInt64.cs | 2 +- .../General/Vector128_1/op_OnesComplement.Byte.cs | 2 +- .../General/Vector128_1/op_OnesComplement.Double.cs | 2 +- .../General/Vector128_1/op_OnesComplement.Int16.cs | 2 +- .../General/Vector128_1/op_OnesComplement.Int32.cs | 2 +- .../General/Vector128_1/op_OnesComplement.Int64.cs | 2 +- .../General/Vector128_1/op_OnesComplement.SByte.cs | 2 +- .../General/Vector128_1/op_OnesComplement.Single.cs | 2 +- .../General/Vector128_1/op_OnesComplement.UInt16.cs | 2 +- .../General/Vector128_1/op_OnesComplement.UInt32.cs | 2 +- .../General/Vector128_1/op_OnesComplement.UInt64.cs | 2 +- .../General/Vector128_1/op_Subtraction.Byte.cs | 2 +- .../General/Vector128_1/op_Subtraction.Double.cs | 2 +- .../General/Vector128_1/op_Subtraction.Int16.cs | 2 +- .../General/Vector128_1/op_Subtraction.Int32.cs | 2 +- .../General/Vector128_1/op_Subtraction.Int64.cs | 2 +- .../General/Vector128_1/op_Subtraction.SByte.cs | 2 +- .../General/Vector128_1/op_Subtraction.Single.cs | 2 +- .../General/Vector128_1/op_Subtraction.UInt16.cs | 2 +- .../General/Vector128_1/op_Subtraction.UInt32.cs | 2 +- .../General/Vector128_1/op_Subtraction.UInt64.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.Byte.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.Double.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.Int16.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.Int32.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.Int64.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.SByte.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.Single.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.UInt16.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.UInt32.cs | 2 +- .../General/Vector128_1/op_UnaryNegation.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Byte.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.Double.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.Int16.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.Int32.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.Int64.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.SByte.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.Single.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.UInt16.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.UInt32.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Abs.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Abs.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Abs.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Abs.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Abs.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Add.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Add.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Add.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Add.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Add.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseAnd.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseAnd.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseAnd.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseAnd.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseAnd.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseAnd.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseOr.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseOr.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseOr.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseOr.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/BitwiseOr.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Ceiling.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Ceiling.Single.cs | 2 +- .../General/Vector256/ConditionalSelect.Byte.cs | 2 +- .../General/Vector256/ConditionalSelect.Double.cs | 2 +- .../General/Vector256/ConditionalSelect.Int16.cs | 2 +- .../General/Vector256/ConditionalSelect.Int32.cs | 2 +- .../General/Vector256/ConditionalSelect.Int64.cs | 2 +- .../General/Vector256/ConditionalSelect.SByte.cs | 2 +- .../General/Vector256/ConditionalSelect.Single.cs | 2 +- .../General/Vector256/ConditionalSelect.UInt16.cs | 2 +- .../General/Vector256/ConditionalSelect.UInt32.cs | 2 +- .../General/Vector256/ConditionalSelect.UInt64.cs | 2 +- .../General/Vector256/ConvertToDouble.Int64.cs | 2 +- .../General/Vector256/ConvertToDouble.UInt64.cs | 2 +- .../General/Vector256/ConvertToInt32.Single.cs | 2 +- .../General/Vector256/ConvertToInt64.Double.cs | 2 +- .../General/Vector256/ConvertToSingle.Int32.cs | 2 +- .../General/Vector256/ConvertToSingle.UInt32.cs | 2 +- .../General/Vector256/ConvertToUInt32.Single.cs | 2 +- .../General/Vector256/ConvertToUInt64.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Divide.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Equals.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAll.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAll.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAll.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAll.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAll.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAll.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAny.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/EqualsAny.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAny.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAny.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAny.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/EqualsAny.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Floor.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Floor.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThan.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThanAll.Byte.cs | 2 +- .../General/Vector256/GreaterThanAll.Double.cs | 2 +- .../General/Vector256/GreaterThanAll.Int16.cs | 2 +- .../General/Vector256/GreaterThanAll.Int32.cs | 2 +- .../General/Vector256/GreaterThanAll.Int64.cs | 2 +- .../General/Vector256/GreaterThanAll.SByte.cs | 2 +- .../General/Vector256/GreaterThanAll.Single.cs | 2 +- .../General/Vector256/GreaterThanAll.UInt16.cs | 2 +- .../General/Vector256/GreaterThanAll.UInt32.cs | 2 +- .../General/Vector256/GreaterThanAll.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256/GreaterThanAny.Byte.cs | 2 +- .../General/Vector256/GreaterThanAny.Double.cs | 2 +- .../General/Vector256/GreaterThanAny.Int16.cs | 2 +- .../General/Vector256/GreaterThanAny.Int32.cs | 2 +- .../General/Vector256/GreaterThanAny.Int64.cs | 2 +- .../General/Vector256/GreaterThanAny.SByte.cs | 2 +- .../General/Vector256/GreaterThanAny.Single.cs | 2 +- .../General/Vector256/GreaterThanAny.UInt16.cs | 2 +- .../General/Vector256/GreaterThanAny.UInt32.cs | 2 +- .../General/Vector256/GreaterThanAny.UInt64.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.Byte.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.Double.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.Int16.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.Int32.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.Int64.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.SByte.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.Single.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.UInt16.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.UInt32.cs | 2 +- .../General/Vector256/GreaterThanOrEqual.UInt64.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.Byte.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.Double.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.Int16.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.Int32.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.Int64.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.SByte.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.Single.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.UInt16.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.UInt32.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAll.UInt64.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.Byte.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.Double.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.Int16.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.Int32.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.Int64.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.SByte.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.Single.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.UInt16.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.UInt32.cs | 2 +- .../General/Vector256/GreaterThanOrEqualAny.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAll.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector256/LessThanAny.UInt64.cs | 2 +- .../General/Vector256/LessThanOrEqual.Byte.cs | 2 +- .../General/Vector256/LessThanOrEqual.Double.cs | 2 +- .../General/Vector256/LessThanOrEqual.Int16.cs | 2 +- .../General/Vector256/LessThanOrEqual.Int32.cs | 2 +- .../General/Vector256/LessThanOrEqual.Int64.cs | 2 +- .../General/Vector256/LessThanOrEqual.SByte.cs | 2 +- .../General/Vector256/LessThanOrEqual.Single.cs | 2 +- .../General/Vector256/LessThanOrEqual.UInt16.cs | 2 +- .../General/Vector256/LessThanOrEqual.UInt32.cs | 2 +- .../General/Vector256/LessThanOrEqual.UInt64.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.Byte.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.Double.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.Int16.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.Int32.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.Int64.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.SByte.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.Single.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.UInt16.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.UInt32.cs | 2 +- .../General/Vector256/LessThanOrEqualAll.UInt64.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.Byte.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.Double.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.Int16.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.Int32.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.Int64.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.SByte.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.Single.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.UInt16.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.UInt32.cs | 2 +- .../General/Vector256/LessThanOrEqualAny.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Max.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Max.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Max.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Max.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Max.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Min.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Min.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Min.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Min.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Min.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Narrow.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Narrow.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Narrow.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Narrow.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Negate.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256/OnesComplement.Byte.cs | 2 +- .../General/Vector256/OnesComplement.Double.cs | 2 +- .../General/Vector256/OnesComplement.Int16.cs | 2 +- .../General/Vector256/OnesComplement.Int32.cs | 2 +- .../General/Vector256/OnesComplement.Int64.cs | 2 +- .../General/Vector256/OnesComplement.SByte.cs | 2 +- .../General/Vector256/OnesComplement.Single.cs | 2 +- .../General/Vector256/OnesComplement.UInt16.cs | 2 +- .../General/Vector256/OnesComplement.UInt32.cs | 2 +- .../General/Vector256/OnesComplement.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Sqrt.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Sqrt.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Sqrt.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Widen.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Widen.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Widen.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Widen.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Widen.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Widen.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Widen.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Xor.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Xor.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Xor.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Xor.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector256/Xor.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Addition.Byte.cs | 2 +- .../General/Vector256_1/op_Addition.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Addition.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Addition.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Addition.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Addition.SByte.cs | 2 +- .../General/Vector256_1/op_Addition.Single.cs | 2 +- .../General/Vector256_1/op_Addition.UInt16.cs | 2 +- .../General/Vector256_1/op_Addition.UInt32.cs | 2 +- .../General/Vector256_1/op_Addition.UInt64.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.Byte.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.Double.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.Int16.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.Int32.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.Int64.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.SByte.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.Single.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.UInt16.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.UInt32.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Byte.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.Double.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.Int16.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.Int32.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.Int64.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.SByte.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.Single.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.UInt16.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.UInt32.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Division.Byte.cs | 2 +- .../General/Vector256_1/op_Division.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Division.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Division.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Division.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Division.SByte.cs | 2 +- .../General/Vector256_1/op_Division.Single.cs | 2 +- .../General/Vector256_1/op_Division.UInt16.cs | 2 +- .../General/Vector256_1/op_Division.UInt32.cs | 2 +- .../General/Vector256_1/op_Division.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Equality.Byte.cs | 2 +- .../General/Vector256_1/op_Equality.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Equality.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Equality.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Equality.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Equality.SByte.cs | 2 +- .../General/Vector256_1/op_Equality.Single.cs | 2 +- .../General/Vector256_1/op_Equality.UInt16.cs | 2 +- .../General/Vector256_1/op_Equality.UInt32.cs | 2 +- .../General/Vector256_1/op_Equality.UInt64.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.Byte.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.Double.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.Int16.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.Int32.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.Int64.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.SByte.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.Single.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.UInt16.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.UInt32.cs | 2 +- .../General/Vector256_1/op_ExclusiveOr.UInt64.cs | 2 +- .../General/Vector256_1/op_Inequality.Byte.cs | 2 +- .../General/Vector256_1/op_Inequality.Double.cs | 2 +- .../General/Vector256_1/op_Inequality.Int16.cs | 2 +- .../General/Vector256_1/op_Inequality.Int32.cs | 2 +- .../General/Vector256_1/op_Inequality.Int64.cs | 2 +- .../General/Vector256_1/op_Inequality.SByte.cs | 2 +- .../General/Vector256_1/op_Inequality.Single.cs | 2 +- .../General/Vector256_1/op_Inequality.UInt16.cs | 2 +- .../General/Vector256_1/op_Inequality.UInt32.cs | 2 +- .../General/Vector256_1/op_Inequality.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Multiply.Byte.cs | 2 +- .../General/Vector256_1/op_Multiply.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Multiply.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Multiply.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Multiply.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_Multiply.SByte.cs | 2 +- .../General/Vector256_1/op_Multiply.Single.cs | 2 +- .../General/Vector256_1/op_Multiply.UInt16.cs | 2 +- .../General/Vector256_1/op_Multiply.UInt32.cs | 2 +- .../General/Vector256_1/op_Multiply.UInt64.cs | 2 +- .../General/Vector256_1/op_OnesComplement.Byte.cs | 2 +- .../General/Vector256_1/op_OnesComplement.Double.cs | 2 +- .../General/Vector256_1/op_OnesComplement.Int16.cs | 2 +- .../General/Vector256_1/op_OnesComplement.Int32.cs | 2 +- .../General/Vector256_1/op_OnesComplement.Int64.cs | 2 +- .../General/Vector256_1/op_OnesComplement.SByte.cs | 2 +- .../General/Vector256_1/op_OnesComplement.Single.cs | 2 +- .../General/Vector256_1/op_OnesComplement.UInt16.cs | 2 +- .../General/Vector256_1/op_OnesComplement.UInt32.cs | 2 +- .../General/Vector256_1/op_OnesComplement.UInt64.cs | 2 +- .../General/Vector256_1/op_Subtraction.Byte.cs | 2 +- .../General/Vector256_1/op_Subtraction.Double.cs | 2 +- .../General/Vector256_1/op_Subtraction.Int16.cs | 2 +- .../General/Vector256_1/op_Subtraction.Int32.cs | 2 +- .../General/Vector256_1/op_Subtraction.Int64.cs | 2 +- .../General/Vector256_1/op_Subtraction.SByte.cs | 2 +- .../General/Vector256_1/op_Subtraction.Single.cs | 2 +- .../General/Vector256_1/op_Subtraction.UInt16.cs | 2 +- .../General/Vector256_1/op_Subtraction.UInt32.cs | 2 +- .../General/Vector256_1/op_Subtraction.UInt64.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.Byte.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.Double.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.Int16.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.Int32.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.Int64.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.SByte.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.Single.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.UInt16.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.UInt32.cs | 2 +- .../General/Vector256_1/op_UnaryNegation.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Byte.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.Double.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.Int16.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.Int32.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.Int64.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.SByte.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.Single.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.UInt16.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.UInt32.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Abs.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Abs.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Abs.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Abs.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Abs.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Add.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Add.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Add.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Add.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Add.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseAnd.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseAnd.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseAnd.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseAnd.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseAnd.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseAnd.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseOr.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseOr.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseOr.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseOr.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/BitwiseOr.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Ceiling.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Ceiling.Single.cs | 2 +- .../General/Vector512/ConditionalSelect.Byte.cs | 2 +- .../General/Vector512/ConditionalSelect.Double.cs | 2 +- .../General/Vector512/ConditionalSelect.Int16.cs | 2 +- .../General/Vector512/ConditionalSelect.Int32.cs | 2 +- .../General/Vector512/ConditionalSelect.Int64.cs | 2 +- .../General/Vector512/ConditionalSelect.SByte.cs | 2 +- .../General/Vector512/ConditionalSelect.Single.cs | 2 +- .../General/Vector512/ConditionalSelect.UInt16.cs | 2 +- .../General/Vector512/ConditionalSelect.UInt32.cs | 2 +- .../General/Vector512/ConditionalSelect.UInt64.cs | 2 +- .../General/Vector512/ConvertToDouble.Int64.cs | 2 +- .../General/Vector512/ConvertToDouble.UInt64.cs | 2 +- .../General/Vector512/ConvertToInt32.Single.cs | 2 +- .../General/Vector512/ConvertToInt64.Double.cs | 2 +- .../General/Vector512/ConvertToSingle.Int32.cs | 2 +- .../General/Vector512/ConvertToSingle.UInt32.cs | 2 +- .../General/Vector512/ConvertToUInt32.Single.cs | 2 +- .../General/Vector512/ConvertToUInt64.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Divide.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Equals.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAll.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAll.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAll.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAll.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAll.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAll.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAny.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/EqualsAny.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAny.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAny.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAny.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/EqualsAny.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Floor.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Floor.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThan.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThanAll.Byte.cs | 2 +- .../General/Vector512/GreaterThanAll.Double.cs | 2 +- .../General/Vector512/GreaterThanAll.Int16.cs | 2 +- .../General/Vector512/GreaterThanAll.Int32.cs | 2 +- .../General/Vector512/GreaterThanAll.Int64.cs | 2 +- .../General/Vector512/GreaterThanAll.SByte.cs | 2 +- .../General/Vector512/GreaterThanAll.Single.cs | 2 +- .../General/Vector512/GreaterThanAll.UInt16.cs | 2 +- .../General/Vector512/GreaterThanAll.UInt32.cs | 2 +- .../General/Vector512/GreaterThanAll.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512/GreaterThanAny.Byte.cs | 2 +- .../General/Vector512/GreaterThanAny.Double.cs | 2 +- .../General/Vector512/GreaterThanAny.Int16.cs | 2 +- .../General/Vector512/GreaterThanAny.Int32.cs | 2 +- .../General/Vector512/GreaterThanAny.Int64.cs | 2 +- .../General/Vector512/GreaterThanAny.SByte.cs | 2 +- .../General/Vector512/GreaterThanAny.Single.cs | 2 +- .../General/Vector512/GreaterThanAny.UInt16.cs | 2 +- .../General/Vector512/GreaterThanAny.UInt32.cs | 2 +- .../General/Vector512/GreaterThanAny.UInt64.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.Byte.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.Double.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.Int16.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.Int32.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.Int64.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.SByte.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.Single.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.UInt16.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.UInt32.cs | 2 +- .../General/Vector512/GreaterThanOrEqual.UInt64.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.Byte.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.Double.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.Int16.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.Int32.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.Int64.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.SByte.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.Single.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.UInt16.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.UInt32.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAll.UInt64.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.Byte.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.Double.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.Int16.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.Int32.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.Int64.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.SByte.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.Single.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.UInt16.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.UInt32.cs | 2 +- .../General/Vector512/GreaterThanOrEqualAny.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAll.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector512/LessThanAny.UInt64.cs | 2 +- .../General/Vector512/LessThanOrEqual.Byte.cs | 2 +- .../General/Vector512/LessThanOrEqual.Double.cs | 2 +- .../General/Vector512/LessThanOrEqual.Int16.cs | 2 +- .../General/Vector512/LessThanOrEqual.Int32.cs | 2 +- .../General/Vector512/LessThanOrEqual.Int64.cs | 2 +- .../General/Vector512/LessThanOrEqual.SByte.cs | 2 +- .../General/Vector512/LessThanOrEqual.Single.cs | 2 +- .../General/Vector512/LessThanOrEqual.UInt16.cs | 2 +- .../General/Vector512/LessThanOrEqual.UInt32.cs | 2 +- .../General/Vector512/LessThanOrEqual.UInt64.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.Byte.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.Double.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.Int16.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.Int32.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.Int64.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.SByte.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.Single.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.UInt16.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.UInt32.cs | 2 +- .../General/Vector512/LessThanOrEqualAll.UInt64.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.Byte.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.Double.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.Int16.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.Int32.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.Int64.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.SByte.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.Single.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.UInt16.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.UInt32.cs | 2 +- .../General/Vector512/LessThanOrEqualAny.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Max.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Max.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Max.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Max.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Max.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Min.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Min.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Min.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Min.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Min.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Narrow.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Narrow.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Narrow.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Narrow.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Negate.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512/OnesComplement.Byte.cs | 2 +- .../General/Vector512/OnesComplement.Double.cs | 2 +- .../General/Vector512/OnesComplement.Int16.cs | 2 +- .../General/Vector512/OnesComplement.Int32.cs | 2 +- .../General/Vector512/OnesComplement.Int64.cs | 2 +- .../General/Vector512/OnesComplement.SByte.cs | 2 +- .../General/Vector512/OnesComplement.Single.cs | 2 +- .../General/Vector512/OnesComplement.UInt16.cs | 2 +- .../General/Vector512/OnesComplement.UInt32.cs | 2 +- .../General/Vector512/OnesComplement.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Sqrt.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Sqrt.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Sqrt.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Widen.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Widen.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Widen.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Widen.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Widen.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Widen.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Widen.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Xor.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Xor.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Xor.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Xor.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector512/Xor.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Addition.Byte.cs | 2 +- .../General/Vector512_1/op_Addition.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Addition.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Addition.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Addition.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Addition.SByte.cs | 2 +- .../General/Vector512_1/op_Addition.Single.cs | 2 +- .../General/Vector512_1/op_Addition.UInt16.cs | 2 +- .../General/Vector512_1/op_Addition.UInt32.cs | 2 +- .../General/Vector512_1/op_Addition.UInt64.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.Byte.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.Double.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.Int16.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.Int32.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.Int64.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.SByte.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.Single.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.UInt16.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.UInt32.cs | 2 +- .../General/Vector512_1/op_BitwiseAnd.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Byte.cs | 2 +- .../General/Vector512_1/op_BitwiseOr.Double.cs | 2 +- .../General/Vector512_1/op_BitwiseOr.Int16.cs | 2 +- .../General/Vector512_1/op_BitwiseOr.Int32.cs | 2 +- .../General/Vector512_1/op_BitwiseOr.Int64.cs | 2 +- .../General/Vector512_1/op_BitwiseOr.SByte.cs | 2 +- .../General/Vector512_1/op_BitwiseOr.Single.cs | 2 +- .../General/Vector512_1/op_BitwiseOr.UInt16.cs | 2 +- .../General/Vector512_1/op_BitwiseOr.UInt32.cs | 2 +- .../General/Vector512_1/op_BitwiseOr.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Division.Byte.cs | 2 +- .../General/Vector512_1/op_Division.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Division.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Division.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Division.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Division.SByte.cs | 2 +- .../General/Vector512_1/op_Division.Single.cs | 2 +- .../General/Vector512_1/op_Division.UInt16.cs | 2 +- .../General/Vector512_1/op_Division.UInt32.cs | 2 +- .../General/Vector512_1/op_Division.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Equality.Byte.cs | 2 +- .../General/Vector512_1/op_Equality.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Equality.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Equality.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Equality.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Equality.SByte.cs | 2 +- .../General/Vector512_1/op_Equality.Single.cs | 2 +- .../General/Vector512_1/op_Equality.UInt16.cs | 2 +- .../General/Vector512_1/op_Equality.UInt32.cs | 2 +- .../General/Vector512_1/op_Equality.UInt64.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.Byte.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.Double.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.Int16.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.Int32.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.Int64.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.SByte.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.Single.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.UInt16.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.UInt32.cs | 2 +- .../General/Vector512_1/op_ExclusiveOr.UInt64.cs | 2 +- .../General/Vector512_1/op_Inequality.Byte.cs | 2 +- .../General/Vector512_1/op_Inequality.Double.cs | 2 +- .../General/Vector512_1/op_Inequality.Int16.cs | 2 +- .../General/Vector512_1/op_Inequality.Int32.cs | 2 +- .../General/Vector512_1/op_Inequality.Int64.cs | 2 +- .../General/Vector512_1/op_Inequality.SByte.cs | 2 +- .../General/Vector512_1/op_Inequality.Single.cs | 2 +- .../General/Vector512_1/op_Inequality.UInt16.cs | 2 +- .../General/Vector512_1/op_Inequality.UInt32.cs | 2 +- .../General/Vector512_1/op_Inequality.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Multiply.Byte.cs | 2 +- .../General/Vector512_1/op_Multiply.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Multiply.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Multiply.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Multiply.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_Multiply.SByte.cs | 2 +- .../General/Vector512_1/op_Multiply.Single.cs | 2 +- .../General/Vector512_1/op_Multiply.UInt16.cs | 2 +- .../General/Vector512_1/op_Multiply.UInt32.cs | 2 +- .../General/Vector512_1/op_Multiply.UInt64.cs | 2 +- .../General/Vector512_1/op_OnesComplement.Byte.cs | 2 +- .../General/Vector512_1/op_OnesComplement.Double.cs | 2 +- .../General/Vector512_1/op_OnesComplement.Int16.cs | 2 +- .../General/Vector512_1/op_OnesComplement.Int32.cs | 2 +- .../General/Vector512_1/op_OnesComplement.Int64.cs | 2 +- .../General/Vector512_1/op_OnesComplement.SByte.cs | 2 +- .../General/Vector512_1/op_OnesComplement.Single.cs | 2 +- .../General/Vector512_1/op_OnesComplement.UInt16.cs | 2 +- .../General/Vector512_1/op_OnesComplement.UInt32.cs | 2 +- .../General/Vector512_1/op_OnesComplement.UInt64.cs | 2 +- .../General/Vector512_1/op_Subtraction.Byte.cs | 2 +- .../General/Vector512_1/op_Subtraction.Double.cs | 2 +- .../General/Vector512_1/op_Subtraction.Int16.cs | 2 +- .../General/Vector512_1/op_Subtraction.Int32.cs | 2 +- .../General/Vector512_1/op_Subtraction.Int64.cs | 2 +- .../General/Vector512_1/op_Subtraction.SByte.cs | 2 +- .../General/Vector512_1/op_Subtraction.Single.cs | 2 +- .../General/Vector512_1/op_Subtraction.UInt16.cs | 2 +- .../General/Vector512_1/op_Subtraction.UInt32.cs | 2 +- .../General/Vector512_1/op_Subtraction.UInt64.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.Byte.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.Double.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.Int16.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.Int32.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.Int64.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.SByte.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.Single.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.UInt16.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.UInt32.cs | 2 +- .../General/Vector512_1/op_UnaryNegation.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Byte.cs | 2 +- .../General/Vector512_1/op_UnaryPlus.Double.cs | 2 +- .../General/Vector512_1/op_UnaryPlus.Int16.cs | 2 +- .../General/Vector512_1/op_UnaryPlus.Int32.cs | 2 +- .../General/Vector512_1/op_UnaryPlus.Int64.cs | 2 +- .../General/Vector512_1/op_UnaryPlus.SByte.cs | 2 +- .../General/Vector512_1/op_UnaryPlus.Single.cs | 2 +- .../General/Vector512_1/op_UnaryPlus.UInt16.cs | 2 +- .../General/Vector512_1/op_UnaryPlus.UInt32.cs | 2 +- .../General/Vector512_1/op_UnaryPlus.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Byte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.SByte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Single.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Byte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.SByte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Single.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector64/BitwiseAnd.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector64/BitwiseAnd.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Ceiling.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Ceiling.Single.cs | 2 +- .../General/Vector64/ConditionalSelect.Byte.cs | 2 +- .../General/Vector64/ConditionalSelect.Double.cs | 2 +- .../General/Vector64/ConditionalSelect.Int16.cs | 2 +- .../General/Vector64/ConditionalSelect.Int32.cs | 2 +- .../General/Vector64/ConditionalSelect.Int64.cs | 2 +- .../General/Vector64/ConditionalSelect.SByte.cs | 2 +- .../General/Vector64/ConditionalSelect.Single.cs | 2 +- .../General/Vector64/ConditionalSelect.UInt16.cs | 2 +- .../General/Vector64/ConditionalSelect.UInt32.cs | 2 +- .../General/Vector64/ConditionalSelect.UInt64.cs | 2 +- .../General/Vector64/ConvertToDouble.Int64.cs | 2 +- .../General/Vector64/ConvertToDouble.UInt64.cs | 2 +- .../General/Vector64/ConvertToInt32.Single.cs | 2 +- .../General/Vector64/ConvertToInt64.Double.cs | 2 +- .../General/Vector64/ConvertToSingle.Int32.cs | 2 +- .../General/Vector64/ConvertToSingle.UInt32.cs | 2 +- .../General/Vector64/ConvertToUInt32.Single.cs | 2 +- .../General/Vector64/ConvertToUInt64.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Divide.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Equals.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Floor.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Floor.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThan.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThan.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThan.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThan.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThan.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThan.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThan.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThan.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThan.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAll.Byte.cs | 2 +- .../General/Vector64/GreaterThanAll.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAll.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAll.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAll.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAll.SByte.cs | 2 +- .../General/Vector64/GreaterThanAll.Single.cs | 2 +- .../General/Vector64/GreaterThanAll.UInt16.cs | 2 +- .../General/Vector64/GreaterThanAll.UInt32.cs | 2 +- .../General/Vector64/GreaterThanAll.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAny.Byte.cs | 2 +- .../General/Vector64/GreaterThanAny.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAny.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAny.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAny.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/GreaterThanAny.SByte.cs | 2 +- .../General/Vector64/GreaterThanAny.Single.cs | 2 +- .../General/Vector64/GreaterThanAny.UInt16.cs | 2 +- .../General/Vector64/GreaterThanAny.UInt32.cs | 2 +- .../General/Vector64/GreaterThanAny.UInt64.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.Byte.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.Double.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.Int16.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.Int32.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.Int64.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.SByte.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.Single.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.UInt16.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.UInt32.cs | 2 +- .../General/Vector64/GreaterThanOrEqual.UInt64.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.Byte.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.Double.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.Int16.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.Int32.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.Int64.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.SByte.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.Single.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.UInt16.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.UInt32.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAll.UInt64.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.Byte.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.Double.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.Int16.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.Int32.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.Int64.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.SByte.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.Single.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.UInt16.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.UInt32.cs | 2 +- .../General/Vector64/GreaterThanOrEqualAny.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAll.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAll.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAll.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAll.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAll.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAll.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAll.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAll.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAll.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAny.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAny.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAny.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAny.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAny.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAny.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAny.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAny.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanAny.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/LessThanOrEqual.Byte.cs | 2 +- .../General/Vector64/LessThanOrEqual.Double.cs | 2 +- .../General/Vector64/LessThanOrEqual.Int16.cs | 2 +- .../General/Vector64/LessThanOrEqual.Int32.cs | 2 +- .../General/Vector64/LessThanOrEqual.Int64.cs | 2 +- .../General/Vector64/LessThanOrEqual.SByte.cs | 2 +- .../General/Vector64/LessThanOrEqual.Single.cs | 2 +- .../General/Vector64/LessThanOrEqual.UInt16.cs | 2 +- .../General/Vector64/LessThanOrEqual.UInt32.cs | 2 +- .../General/Vector64/LessThanOrEqual.UInt64.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.Byte.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.Double.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.Int16.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.Int32.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.Int64.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.SByte.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.Single.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.UInt16.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.UInt32.cs | 2 +- .../General/Vector64/LessThanOrEqualAll.UInt64.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.Byte.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.Double.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.Int16.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.Int32.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.Int64.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.SByte.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.Single.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.UInt16.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.UInt32.cs | 2 +- .../General/Vector64/LessThanOrEqualAny.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Byte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.SByte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Single.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Byte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.SByte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Single.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Narrow.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Narrow.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Narrow.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Narrow.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Negate.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/OnesComplement.Byte.cs | 2 +- .../General/Vector64/OnesComplement.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64/OnesComplement.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64/OnesComplement.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64/OnesComplement.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64/OnesComplement.SByte.cs | 2 +- .../General/Vector64/OnesComplement.Single.cs | 2 +- .../General/Vector64/OnesComplement.UInt16.cs | 2 +- .../General/Vector64/OnesComplement.UInt32.cs | 2 +- .../General/Vector64/OnesComplement.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Sqrt.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Sqrt.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.Byte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.SByte.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.Single.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Widen.Double.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Widen.Int16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Widen.Int32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Widen.Int64.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Widen.UInt16.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Widen.UInt32.cs | 2 +- .../JIT/HardwareIntrinsics/General/Vector64/Widen.UInt64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Byte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Double.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int64.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.SByte.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Single.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt16.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt32.cs | 2 +- src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Addition.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Byte.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.Double.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.Int16.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.Int32.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.Int64.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.SByte.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.Single.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.UInt16.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.UInt32.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Byte.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.SByte.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.Single.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.UInt16.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.UInt32.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Division.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Equality.UInt64.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.Byte.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.Double.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.Int16.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.Int32.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.Int64.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.SByte.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.Single.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.UInt16.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.UInt32.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Inequality.Byte.cs | 2 +- .../General/Vector64_1/op_Inequality.Double.cs | 2 +- .../General/Vector64_1/op_Inequality.Int16.cs | 2 +- .../General/Vector64_1/op_Inequality.Int32.cs | 2 +- .../General/Vector64_1/op_Inequality.Int64.cs | 2 +- .../General/Vector64_1/op_Inequality.SByte.cs | 2 +- .../General/Vector64_1/op_Inequality.Single.cs | 2 +- .../General/Vector64_1/op_Inequality.UInt16.cs | 2 +- .../General/Vector64_1/op_Inequality.UInt32.cs | 2 +- .../General/Vector64_1/op_Inequality.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.Byte.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.SByte.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.Single.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt64.cs | 2 +- .../General/Vector64_1/op_OnesComplement.Byte.cs | 2 +- .../General/Vector64_1/op_OnesComplement.Double.cs | 2 +- .../General/Vector64_1/op_OnesComplement.Int16.cs | 2 +- .../General/Vector64_1/op_OnesComplement.Int32.cs | 2 +- .../General/Vector64_1/op_OnesComplement.Int64.cs | 2 +- .../General/Vector64_1/op_OnesComplement.SByte.cs | 2 +- .../General/Vector64_1/op_OnesComplement.Single.cs | 2 +- .../General/Vector64_1/op_OnesComplement.UInt16.cs | 2 +- .../General/Vector64_1/op_OnesComplement.UInt32.cs | 2 +- .../General/Vector64_1/op_OnesComplement.UInt64.cs | 2 +- .../General/Vector64_1/op_Subtraction.Byte.cs | 2 +- .../General/Vector64_1/op_Subtraction.Double.cs | 2 +- .../General/Vector64_1/op_Subtraction.Int16.cs | 2 +- .../General/Vector64_1/op_Subtraction.Int32.cs | 2 +- .../General/Vector64_1/op_Subtraction.Int64.cs | 2 +- .../General/Vector64_1/op_Subtraction.SByte.cs | 2 +- .../General/Vector64_1/op_Subtraction.Single.cs | 2 +- .../General/Vector64_1/op_Subtraction.UInt16.cs | 2 +- .../General/Vector64_1/op_Subtraction.UInt32.cs | 2 +- .../General/Vector64_1/op_Subtraction.UInt64.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.Byte.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.Double.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.Int16.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.Int32.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.Int64.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.SByte.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.Single.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.UInt16.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.UInt32.cs | 2 +- .../General/Vector64_1/op_UnaryNegation.UInt64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Byte.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.Double.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int16.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int32.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int64.cs | 2 +- .../HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.SByte.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.Single.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.UInt16.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.UInt32.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.UInt64.cs | 2 +- 1837 files changed, 1837 insertions(+), 1837 deletions(-) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBinaryOpTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBinaryOpTest.template index 081be7d0e3cf96..54b276bdca1a59 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBinaryOpTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBinaryOpTest.template @@ -73,7 +73,7 @@ namespace JIT.HardwareIntrinsics.General int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > {LargestVectorSize}) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBinaryOperatorTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBinaryOperatorTest.template index f0e47a2b4b55da..4d953387db0fe6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBinaryOperatorTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBinaryOperatorTest.template @@ -73,7 +73,7 @@ namespace JIT.HardwareIntrinsics.General int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > {LargestVectorSize}) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAllBinaryOpTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAllBinaryOpTest.template index 62d2e7d49373b2..dfd258833e3b50 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAllBinaryOpTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAllBinaryOpTest.template @@ -70,7 +70,7 @@ namespace JIT.HardwareIntrinsics.General { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > {LargestVectorSize}) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAllBinaryOperatorTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAllBinaryOperatorTest.template index b643a1bf3bda68..3ed1bb9403fba7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAllBinaryOperatorTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAllBinaryOperatorTest.template @@ -70,7 +70,7 @@ namespace JIT.HardwareIntrinsics.General { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > {LargestVectorSize}) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAnyBinaryOpTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAnyBinaryOpTest.template index a301ffc46248d2..abe4eee604245d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAnyBinaryOpTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAnyBinaryOpTest.template @@ -70,7 +70,7 @@ namespace JIT.HardwareIntrinsics.General { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > {LargestVectorSize}) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAnyBinaryOperatorTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAnyBinaryOperatorTest.template index e631b99981027c..7623b1721e86c1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAnyBinaryOperatorTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorBooleanAnyBinaryOperatorTest.template @@ -70,7 +70,7 @@ namespace JIT.HardwareIntrinsics.General { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > {LargestVectorSize}) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorConvertToTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorConvertToTest.template index 1c6f4bb5226e8f..3c6d8c0baab812 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorConvertToTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorConvertToTest.template @@ -70,7 +70,7 @@ namespace JIT.HardwareIntrinsics.General { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > {LargestVectorSize}) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorDotTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorDotTest.template index 92ebb74d2a9b7c..056dc05acc1574 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorDotTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorDotTest.template @@ -70,7 +70,7 @@ namespace JIT.HardwareIntrinsics.General { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > {LargestVectorSize}) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorNarrowTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorNarrowTest.template index 192bdd45bb2a8c..44f109d4c6f7d0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorNarrowTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorNarrowTest.template @@ -73,7 +73,7 @@ namespace JIT.HardwareIntrinsics.General int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > {LargestVectorSize}) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorTernaryOpTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorTernaryOpTest.template index 4477e47971a7e0..dd51391b96ddd9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorTernaryOpTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorTernaryOpTest.template @@ -76,7 +76,7 @@ namespace JIT.HardwareIntrinsics.General int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<{Op3BaseType}>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > {LargestVectorSize}) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorUnaryOpTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorUnaryOpTest.template index 52ffd0209a5e63..eb80b1cbde78ed 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorUnaryOpTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorUnaryOpTest.template @@ -70,7 +70,7 @@ namespace JIT.HardwareIntrinsics.General { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > {LargestVectorSize}) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorUnaryOperatorTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorUnaryOperatorTest.template index d1283c3ebd8720..833b83cb90a016 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorUnaryOperatorTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorUnaryOperatorTest.template @@ -70,7 +70,7 @@ namespace JIT.HardwareIntrinsics.General { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > {LargestVectorSize}) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorWidenTest.template b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorWidenTest.template index ac48a3bd5e7bd8..6952a044300943 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorWidenTest.template +++ b/src/tests/JIT/HardwareIntrinsics/General/Shared/VectorWidenTest.template @@ -73,7 +73,7 @@ namespace JIT.HardwareIntrinsics.General int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf<{RetBaseType}>(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > {LargestVectorSize}) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Byte.cs index b354e05f9540c6..5fdf63e3b26062 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Double.cs index 172c030ab433ed..a7570d23b933f9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int16.cs index afb771426afad5..47f3457903e96b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int32.cs index 3340e7d0222fef..04e43fba93ffdb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int64.cs index 42e091c3143f40..b86384bcaf0b1c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.SByte.cs index 21091de0c7c0a4..f90ff28adb3157 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Single.cs index 654e9bf002de64..ffb4b35f9b67a4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt16.cs index 15546b956193e1..d658093561d0fa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt32.cs index 4aab00b70a2fb2..08e1915c583f68 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt64.cs index cf7b26e7b04cc2..6d2625b77af20f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Byte.cs index baba042950e4a8..1099b23ef95c23 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Double.cs index d3de29d896fc7c..8a4ff68e0850b1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int16.cs index 2b78899ddf1d0f..65f384a4f0b327 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int32.cs index b5f285b3d55dd6..adaf0e9f986025 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int64.cs index 3c6786bcfdcd08..f51eba03ca0816 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.SByte.cs index 8fa28868af0fdf..92dec6f9ae014e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Single.cs index d1891801e7f6a6..3e6c884113d00a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt16.cs index a2890444fbe0f9..10ea648f7066d4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt32.cs index 476ac7a6a3ba93..187657e0cf2c29 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt64.cs index 0142ee75c164e2..794965f70434be 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Byte.cs index 31a70ef6dd210d..7ebcea462fe682 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Double.cs index cc3cbd010a509d..ed20d6a83161dd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int16.cs index 7ef28b15652807..ee5f4564d76916 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int32.cs index bfbb747119175f..425f572535a9f8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int64.cs index 3df68fc084f5a9..2e725ef77512f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.SByte.cs index 653a6bff0cd207..1e1514ebd3c709 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Single.cs index f2546ac6c9848a..dc379796db278b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt16.cs index e1fc4e57d3412d..0528306bad33d9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt32.cs index a6a014f428fc0a..615d6b466c614e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt64.cs index 134dfa4de22876..00efd84e8fee78 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Byte.cs index aadf92bbbf8bd6..f797863f56f14a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Double.cs index 9a1d44d91af35a..50717cfe31faf1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int16.cs index 9c268be925176c..744007ac4bb815 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int32.cs index db40c9ef60b1f6..9deacd5e6d94fc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int64.cs index 25ca36d3e8ef95..9c2a8bc041177e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.SByte.cs index 06b8a51cbf3c51..29ed92df7da413 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Single.cs index fb5ac4ecfeb31a..3c2aa493be1be0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt16.cs index 4de16a6179e9e1..2e47385e39d053 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt32.cs index 29f83d824a40ae..d6718cd7dfe97b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt64.cs index d3d0b04c3aca94..0898f456d8e902 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Byte.cs index 0e636d8208521c..ed695ece044eff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Double.cs index cd7ec81bd4f503..0552e6548c07f3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int16.cs index 607e28c08142ba..20eab5ab5f1a32 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int32.cs index 17b2f97f6e403d..70fdc2e662184a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int64.cs index f8d06a37981a0f..b2cd189b80dc01 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.SByte.cs index 0473bc2ea647e5..c3029516c382c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Single.cs index 3e0636745c4662..172fbd6031d774 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt16.cs index 267411eb74b698..c47b106408fdb6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt32.cs index c1bfb66f606cfd..bc18b98d24c2aa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt64.cs index 52f24ab2b80c8e..5b1909f5b7222b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Double.cs index 582ad31eb85b77..6caea1097c7cec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Single.cs index aca473bc3d6f42..9f51b97b7fb1ff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Byte.cs index 6eaa3edc0275d6..ea7f495d37f4fd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Byte.cs @@ -76,7 +76,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] inArray3, Byte[] outAr int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Double.cs index 2cf512e75cfe3e..c733bec8a38452 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Double.cs @@ -76,7 +76,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] inArray3, Double int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int16.cs index ffa7ea1e61ac70..3c6c6921c50dcf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int16.cs @@ -76,7 +76,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int32.cs index bc42ecdcf3a67e..edab91467c5502 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int32.cs @@ -76,7 +76,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int64.cs index 0f828aa0577b0b..f1a7680999639f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int64.cs @@ -76,7 +76,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] inArray3, Int64[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.SByte.cs index 5d87eea804ba5a..73c1d42e7aa86d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.SByte.cs @@ -76,7 +76,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] inArray3, SByte[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Single.cs index 132bd3fe355f1e..49988bed327fd1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Single.cs @@ -76,7 +76,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt16.cs index dabffb044cc024..a4b704455104e9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt16.cs @@ -76,7 +76,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] inArray3, UInt16 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt32.cs index 3d44551cd35d3f..3588c4644cd0ff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt32.cs @@ -76,7 +76,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] inArray3, UInt32 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt64.cs index d8e1905aa72a2c..335dce5aa66872 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt64.cs @@ -76,7 +76,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] inArray3, UInt64 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.Int64.cs index a28b50d0315387..7ce09c4bba89de 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.UInt64.cs index 7a1f2575d56bfb..8ae2d62323b370 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt32.Single.cs index 8f07c09ce24c01..f5c9554197a567 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt64.Double.cs index fdcd093afa138e..0a519697029bf7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.Int32.cs index 339d8ce6a8569c..eed4e4f3fee13d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.UInt32.cs index 97355604913282..c9fcdea7f90962 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt32.Single.cs index 60d2cfd6cfc180..09dd852366ee4e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt64.Double.cs index 846e21ce45d216..e26765b741ab39 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Byte.cs index d8f85f00faaab4..e21ecdf863c825 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Double.cs index 36931185ad2c78..93601ebb4e43f8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int16.cs index 881a73733a3b12..ff6c49fa03b835 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int32.cs index c5790d1695b433..afe844d0af0330 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int64.cs index 9e0b7d0d3381a7..3406791307563b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.SByte.cs index 839dd043317b7f..3c0f97e60c6700 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Single.cs index d17e5948a36a58..3c45e868368c20 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt16.cs index 78f97d1d40f61a..1d5f9ddc598ea7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt32.cs index aec20a10cc3513..2856f60488e424 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt64.cs index cd864096d6fa73..4c0681d3db25fc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs index a765323977054e..a90aa91c290d12 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs index 31356baab6ba99..c78a7e781ea748 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs index 0132ee2f901b4f..6af78ab044679a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs index 2f82c523040b8e..1978ad812163d3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs index fdd55bfdcfe65e..33643deeff84a2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs index 223eeec93e8210..b23a0b74e01e05 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs index 29cd69cd575c55..7c812ec7f3946c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs index 3a6c3a87e83112..3af9759b78acb0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs index bf96150f4c1460..cc003b8323afb6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs index 37e88f6e158cc4..8c7ba5a7e2983e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Byte.cs index d371c60b4bc2b8..c98a4bc8cd4460 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Double.cs index f8e04ef14af990..28d51197e90593 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int16.cs index 992c6511da902d..10fe51e7741874 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int32.cs index 680f0fb727468f..38cbe5556a1134 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int64.cs index 9cfa177fcdadb0..916af21d43e16b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.SByte.cs index 74d7513b10ffc8..694dd545dd3dc6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Single.cs index 038c409d2c182c..08cf31a72797d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt16.cs index 51f9d09b09fc22..65940866ed60a3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt32.cs index a9cc7f1e4c46c6..1f87a9168edfe8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt64.cs index e3b9db2b57f34a..c9a98472c261ae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Byte.cs index bccf4a18ed6393..3ca65dceca9230 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Double.cs index 8774fea64e1836..802e80317476d7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int16.cs index 522706cf189110..2c1b246a1add02 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int32.cs index 18e88f783214fc..ea51a5d97821a7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int64.cs index 866c47e4502034..fd13d355f56c1a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.SByte.cs index 6de7e518f49302..0342511a25fba2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Single.cs index 4c0b269877232a..2ee243bc6ca2b2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt16.cs index 9ce78fbf047f8f..9491a0c2b0e408 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt32.cs index f7616e14d3b2a9..aa00a2eaee5e1f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt64.cs index d44c021e9f2522..0ae60868d8d243 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Byte.cs index 3865098080bec5..5ac6107234a8b8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Double.cs index c36d6d78f90fd5..f004fee6631a92 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int16.cs index 1366153e4b8dc6..7cbbe6bf6452f2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int32.cs index 25c5c13ab57e6b..b0656ace5feed2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int64.cs index 6871e748853a81..d6eaf8536e8f91 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.SByte.cs index 91bcece3241ba0..a233011a7e1064 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Single.cs index 2e5001a559b7de..87eadf29412d00 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt16.cs index 20fea410e04fa0..fb0e83c1d62a4e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt32.cs index 423f008796f3f7..2677e397a3b14f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt64.cs index 712948ef5e62f3..96f90e0c4ce15f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Double.cs index aedde51341ac02..12b3420550344d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Single.cs index c5e1de336bfb1e..92299600d442f2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Byte.cs index 949b258b5cb381..7c83d98f87603d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Double.cs index 4ffde433ad9887..731574aff5d8e4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int16.cs index 39154363e9e2c6..fdb6afaef2787a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int32.cs index 5578505483b18b..974a06a9d184c5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int64.cs index 51e6b64cb4644b..f622e26f18bfcf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.SByte.cs index 78d29864aab466..62575e911e9894 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Single.cs index 15d8fbd80c1b49..9dcae7c568ca79 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt16.cs index 8d15fdb9a39c2e..78fc8af921192e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt32.cs index 8107d5c0fdadf5..aa8e322c2c245d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt64.cs index aab452190c725f..a740f55b711ad2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Byte.cs index 404f2d1a0b36ff..fc7f7d1f999256 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Double.cs index 9b3c12ac9ef76b..1d1b3344720a53 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int16.cs index 94a848b05d2ca2..8f421e59fb4279 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int32.cs index 04cc56397e7bf6..c6da7d2264113d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int64.cs index b0ee8ff6ff0eff..b86c6026e3e148 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.SByte.cs index dffde7e0e753af..8f0a8fa47b733d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Single.cs index 7bd63fd41fe950..7fd977c98b0742 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt16.cs index 6b3decfdbb82a1..6247b7ffcc7299 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt32.cs index 4a022aee3fc373..73f769e8502f23 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt64.cs index 6032ba9a143a16..34576fe974143b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Byte.cs index f9b3d3e1bacf70..0591d59afb9710 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Double.cs index 12dbf25348acec..881b0708668bf0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int16.cs index 51f2950daa3fc6..04ee0e9dd9d8fe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int32.cs index df6e2ad6966d09..d178886a7827d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int64.cs index 3f96b249009521..a1a55718b5a997 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.SByte.cs index d5238b36fd13de..b43b4d6a5beec6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Single.cs index c030910e29066c..443c9f9b28e905 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt16.cs index cbe6bc2961f421..b3515fb0713b1d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt32.cs index 5a6ee894cff569..cc329414feb092 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt64.cs index d766b0aeea6866..638c718092f7eb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Byte.cs index 600fba9b53a4a0..31bf7a269d2827 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Double.cs index f801327229caed..7bcd2dc9435712 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int16.cs index 521aea88c6c670..c9ab257e4d4a32 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int32.cs index fe1df4c7ec04d1..1187105ec5b6bc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int64.cs index f631ae3dcd942f..363cf6df06a468 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.SByte.cs index ef287886e3d181..d0a414f7eecec7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Single.cs index 74a2faef48e823..f5334055a8326d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt16.cs index e7f590432d663f..9bb090e490385d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt32.cs index 59da5775c72376..fcdc86bd143b44 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt64.cs index ecbd110275343c..b4a3ff141f7076 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Byte.cs index 16210dedebbdf8..a339139b7513bb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Double.cs index 2aedd149c915c2..5dc01c96712924 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int16.cs index 980f9a55946d7b..c0d70159749978 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int32.cs index 1d53866825a25b..6b55b81f5046cf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int64.cs index ea5daf586fdc32..38d2e1bd3218b8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.SByte.cs index afa483f2c719ad..de778a8701683c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Single.cs index e96ad7e76aa827..9f33d60ac130e1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt16.cs index 3520f870b3bedd..c3f3e951bb39b3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt32.cs index 235bee52ad5f6e..407b1fe98b8417 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt64.cs index 066210bc69904e..ee7b4598f00e8e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Byte.cs index 61187dfae43f55..414033ba1a84f5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Double.cs index 2e529281797b58..1805578d6f695c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int16.cs index 9ddfe14d584038..523222169cb045 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int32.cs index 626891832eb050..cd2f81d668fad8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int64.cs index 5ffbf6b0c9d403..6759ad1abb2364 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.SByte.cs index 48c43e65777257..fc783426a674af 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Single.cs index 5e0745da3db755..6f30ef4805a075 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt16.cs index 9f3b6fbf167523..b07e85aa917e8a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt32.cs index 44746700b758d0..a92ff62fce4d33 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt64.cs index 4a7e2cec036cf3..08da64978cac7a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Byte.cs index a72d55a967a11d..009fa5340a10fd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Double.cs index 4a995254fdb09f..30b683466899a1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int16.cs index 8350d398b9b344..8db4df9e773827 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int32.cs index 037054a6cd3c2b..a2bb121b0911f7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int64.cs index 2d60812e417370..4e59289f3599ff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.SByte.cs index 83ee17ccd608b8..e4d9010a28ed95 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Single.cs index 83ce305c9cb947..d75e3a6f1d11dd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt16.cs index 48db6c6932f484..197077ecba7039 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt32.cs index 89a7262f132976..03588351fe3d6f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt64.cs index d17a85f9ee0d80..00da3a586551ba 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Byte.cs index 94e70de8202b2b..4a3d08afd78d4f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Double.cs index deaa71eb813351..7d9130b25e2d11 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int16.cs index 6e204338bbf672..dfd9df4e3be441 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int32.cs index dc796b948a7c0f..75dcc5888dc40f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int64.cs index e3bf0b1d601196..c099f49119493e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.SByte.cs index a9fd57e42c5476..f1990ec127e5de 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Single.cs index 9c4b1f0e810c96..97c904e856279e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt16.cs index 78f295b591b809..4a996817cf1681 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt32.cs index ec91407dee0ce7..6341ddf48d2336 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt64.cs index 398b9dc456347d..5413be4d033d2e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Byte.cs index a6252a56763dd2..5dc722df128f1d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Double.cs index 5b7852d1a50a80..f90fa9346ef11b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int16.cs index c577dea6f4c030..23a0b4a5899040 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int32.cs index 1ca530ff92caa5..282d8b7c03e50c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int64.cs index 2091868dbdc07d..bb6b0ac75e565b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.SByte.cs index 43b103ac17660a..474681b5e2d2b9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Single.cs index 98c6f6c588c0a1..b406dbcafa0162 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt16.cs index eff32c4b35b6a3..167661fe0c14e8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt32.cs index 8752fc4e63b142..cdcc426e38b7f0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt64.cs index 6c9efa04854ed2..b34c060ad3c4f6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Byte.cs index d919a1b5898b82..6f492f5a3d3595 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Double.cs index 381ac73bc706f4..359d8384c1e27b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int16.cs index c10417aecc7aa3..a8e847a23680cb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int32.cs index d37213519c394d..19e66e6ba9f846 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int64.cs index 59b2f566732c8a..d0c65c9a35c499 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.SByte.cs index 7ddb03549d9eb2..b654f65a8fec3f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Single.cs index c5f06574511524..7618dff86f11cd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt16.cs index 09bb219895e22f..02204a4d6c4505 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt32.cs index 5979152fdf4280..89e79f69f7e3d0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt64.cs index 810c21af414569..80e90e796608c7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Byte.cs index 7ab19aa0be2c20..0a667fa430a932 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Double.cs index ee6c4ec6e9bc92..a4f3492c2d6990 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int16.cs index 636ecbd61fd40e..8334209a242eec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int32.cs index 413c896b761c2f..8b7b5a78e45851 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int64.cs index c6c11cfb0758c3..30c54259c769ba 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.SByte.cs index 8a283499cfdd97..bd187f62e4596b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Single.cs index 68647673c40751..1ef7dabccd5404 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt16.cs index 8ba88ba60038f9..53a6ec4e0119ee 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt32.cs index db27067d242573..638735e9712251 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt64.cs index 6881cb93660a8b..0c386ef47dc1b2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Byte.cs index 22686c93d44aa1..e214058707d09e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Double.cs index 210c9eda5d44f3..7be9e4b4e311ff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int16.cs index 8db33773d5ddd2..b89d325ddd63e7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int32.cs index 00a36594720cfd..24c6cae916d42c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int64.cs index a9e7f83c105713..245dcba0eddd8a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.SByte.cs index 6ab20b44ca070e..328085dc4fa4d8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Single.cs index 570b9d7f6b4bb9..fbfaf06b8e42c3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt16.cs index 5a9ecd6487dc98..eb5c55471f5c98 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt32.cs index 096e3e50c18602..0c7c5474dc6eca 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt64.cs index 27eb52c1e5c805..9fb7ea5b9e9143 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Byte.cs index 68c8a27c97e136..3313ec6f6da3f4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Double.cs index b5358fe7e0e0e2..9217ab90109156 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int16.cs index 5e2ac793cad2a2..504c200f9230b7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int32.cs index 8062de944797c8..4201ce2d615e1c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int64.cs index e7ea428e5dc4a0..492f30582c4fe4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.SByte.cs index cb26ecca10fb9a..ceafc180edccaf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Single.cs index 5044e71dcceea1..ed774dd9725475 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt16.cs index c74d90457c690e..88db6f731b4968 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt32.cs index 3e6ea8b97943dc..2eb09ef255e351 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt64.cs index bb37531d72c254..18f4a554c412b2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Byte.cs index a0f6ce709c2bf0..be5743fb8c1391 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Double.cs index b3b2212768758d..a461545d050ecf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int16.cs index a7b8add679e197..58cbb795f6f6d9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int32.cs index 6860c38cdb474b..71798ef1a11b4e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int64.cs index 17825bb4aeeadf..252e530907153a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.SByte.cs index 75eb3b2aae5277..fcf51be9c12fef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Single.cs index d4271eeabe434c..730e2254cc1224 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt16.cs index 61812a7b86f5f7..32d9b393f7d954 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt32.cs index c5126f83b25a82..50fc1a1cd64884 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt64.cs index a2bc4d7ca50782..51544103c50bed 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Byte.cs index d5e542c3121bad..61b03627a4d84d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Double.cs index fbb64044c288d9..6cc2afe4045e81 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int16.cs index ea5dd38a19f857..6734a0793c412e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int32.cs index 63f129385c448e..64cd0f0a1b6520 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int64.cs index f00ced095327b0..39afc884ec2030 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.SByte.cs index 4d8aad15ea7154..086f1848a94906 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Single.cs index 6de01e64940692..7074c186a3dfcc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt16.cs index ccac89cdd304d8..86956da2adef1d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt32.cs index 1a1b5669ba3406..bbdb4b6f6835d5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt64.cs index ad065e5521eedf..03c04de59d91d7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Double.cs index 62d5dd3643f420..3506ab36b640db 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int16.cs index d0918510e7dc23..21c5e24cfefbbe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int32.cs index e79bf46ec73dd7..002d6a86701572 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int64.cs index baaea24a631c10..8d58e1ca29f5e9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt16.cs index d04196112ebaac..bdcdf9f6f6d884 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, Byte[] outArray, int alig int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt32.cs index ecf9576d10b8b9..c18951ff6d4a23 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt64.cs index 0e16a31c7a934d..723df02c84a61d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Byte.cs index f070fddb22fd71..01cac29f4eeffa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Double.cs index 0f6d1f5fdc804c..8d23fa65c16a59 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int16.cs index 25ebba90c7fd7b..5b74b4743ecad8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int32.cs index 6047831ac9047f..ba24bcc97ae0d8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int64.cs index 4e766257283f9e..6c63447bc0a1dc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.SByte.cs index 4989c9f5aa4c3d..12d11ce352b43c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Single.cs index 83860257c10d67..16ed7c1b476fea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt16.cs index 784901c7e01e5b..6ad85a2b12f48f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt32.cs index 7fa843ccee4a74..0575e7a921645b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt64.cs index 040146186d9aae..d5b5bd6301bd46 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Byte.cs index 2074a90fb493e1..a024b14482bfb8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Double.cs index abb4e5fad8569a..4b883e2454f8b9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int16.cs index e4ca95d4011a07..29466f54a936e6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int32.cs index b38e6bc881ea47..36c88e664b502f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int64.cs index 03bb9888dc283e..d8f90a7aa01f9f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.SByte.cs index 25f5e5fdb67873..5a6af134b88318 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Single.cs index 45f37b00af178c..3dafd6ef34d304 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt16.cs index 9d5a4bf2740b0a..4cf7b1dbf73e02 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt32.cs index c31380f638932a..81a282e6889720 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt64.cs index ef882ad119dd95..ee271905626f1c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Byte.cs index 8fa8660be9ba98..74c2b20756a8fc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Double.cs index e90ac60c713fa3..aa344f305720db 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int16.cs index 690def7db47a8c..b7057bd8e97f6e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int32.cs index de7668c0993033..dce4214679a7c6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int64.cs index be80cd5ab4ab94..3581fcc3b63cfb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.SByte.cs index 209bfd91113e70..76f1e55dec0fb5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Single.cs index 8816c13e8a99bf..f01544d71bd628 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt16.cs index 1c433ba2813fcd..2f171f9f1b3d31 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt32.cs index 862fc8dd6fc6e9..493948ae8a7696 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt64.cs index 23e8b7589c9b3c..b19826480ef2ea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Byte.cs index b275f332fb819e..b694039349d514 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Double.cs index 08e8cb5104e2ba..d9045d03aac05f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int16.cs index c215c5e7f33fcd..2eb7bbc1bae5e3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int32.cs index a1e02e6f0c56a6..a9e40a6630bbb4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int64.cs index e9705961d108af..60880df9cdd204 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.SByte.cs index 2e33d657af8541..a03123647884f2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Single.cs index 8a79b4b71f548c..a07a55e6c29bae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt16.cs index e427ecef966a78..94f31182e81328 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt32.cs index 16707ab9e600f2..c7a6e05ed9dc9c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt64.cs index d58992ae006c40..7addb0d4a9b837 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Double.cs index 162454889e396e..6464e160f458bb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Double.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Double[] outLowerArray, Double[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int16.cs index d22a9e7e9d733e..ee76f49c87927e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int16.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, Int16[] outLowerArray, Int16[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int32.cs index 8ad165f973bc9e..55c765848bf77a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int32[] outLowerArray, Int32[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int64.cs index 3b345a153f3c79..ae53e4c4f4cbac 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int64[] outLowerArray, Int64[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt16.cs index 5924c11d53b135..9abf0a3d24897e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, UInt16[] outLowerArray, UInt16[] outUpperArray int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt32.cs index d9292b734396a1..c32799759a76c9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt32[] outLowerArray, UInt32[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt64.cs index 6575833d316691..a6ab95b6e9c176 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt64[] outLowerArray, UInt64[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Byte.cs index acc49aa40796db..d55af3ec5af6c3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Double.cs index 550b4e7c9a9aa0..50c0d0858e4841 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int16.cs index e237f406251f4a..3331da7108b8c6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int32.cs index 824089c27f4874..86195a6fdeca8a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int64.cs index b65107b3065891..0375b57067bf90 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.SByte.cs index d35c1af64edcda..9926e428d59b29 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Single.cs index e50b922a328366..67358377463015 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt16.cs index 89db57c4fa62c4..b86eb0f2a7de89 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt32.cs index 31c0c4ca987b3d..b76d24466ef367 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt64.cs index 41b27597af7524..b71007b0c28353 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Byte.cs index dcf60f00174b7b..f42b1b5c0e798c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Double.cs index 4ea4912a602a3b..0f0895e2f42afc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int16.cs index 1486104eac9623..b3d9cbc22ba712 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int32.cs index 13732e90ca4e52..2e367342c85772 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int64.cs index 5dd37bbd2d3a21..1b6cec1b58bf1f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.SByte.cs index 0195302e814d6d..1b2fdbc3647c1f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Single.cs index 74b5a5bc43d5ab..1330317adc50ea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt16.cs index 8454d3c484edef..ac286b15013b9d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt32.cs index 5267b090b9bc04..da113189de5388 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt64.cs index d3b06bf18d356a..88360377ded9c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Byte.cs index 437552617317d4..0e0475db080602 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Double.cs index 94c0be659211af..3352e894a0bc2b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int16.cs index ec85f0e7d42843..e357116963a3dc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int32.cs index 40d791a5ace111..5097d936fc5fd9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int64.cs index 47984b82d773d4..91ebd92665d19e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.SByte.cs index b5e466386e7103..af196f1ab8f323 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Single.cs index c3a42cd096fd65..f8e4023ac820bc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt16.cs index 53d79092bb836b..c5f8ec4dbc1ccf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt32.cs index 11d43c44b4fa7c..1a6c9e16143470 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt64.cs index 90d59096e456bc..1c63acf4cd1f1e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Byte.cs index e9ae725614ece4..ab34d00a98f697 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Double.cs index 1864d9461d477a..703ebdf84923dc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int16.cs index 8b03219c7b8573..756a1ed56e4b34 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int32.cs index 03c3778516cedb..c835d85433eee7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int64.cs index be8181fc67a6af..1088ba50f98f7d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.SByte.cs index 3db51f2473c064..08ea29a733b64b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Single.cs index b55d8e7b931819..2e2e50a2522580 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt16.cs index 1529da0f39bdcb..15d426eac7dea8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt32.cs index 3f40078543d6fd..b80c3a76727e8c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt64.cs index 514c4395c2a704..eeb912f98ed886 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Byte.cs index a5346c88efe371..4eb8b516eb8503 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Double.cs index 5ae3bc769f22a8..dc0abc1ef4c44e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int16.cs index e980d58450bbc6..651ae97f8d80f8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int32.cs index 08df8da75ed1c1..891a2c4d9fc1d7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int64.cs index 52014358aac05e..3243b61f6986c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.SByte.cs index 579c90236112df..b5cf029f7a6707 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Single.cs index 72d7dae99099d7..7959dbaaba99ae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt16.cs index a96e46e488f523..f1edbb05c8492e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt32.cs index d26e6d985e557a..916749722544b4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt64.cs index f322cc47301012..b0406de7008831 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Byte.cs index 260d96034e1c64..236d370bc6ced8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Double.cs index 7518a01ea29a6a..4a9ac8c5a54270 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int16.cs index 1a8c1d755e4a6f..9fc8f316b94f1f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int32.cs index 8e11218ac8926e..9522aa94877f38 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int64.cs index 77427570080009..43a49d2553ea74 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.SByte.cs index f20e9b519c9c32..4f72a284cf15a2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Single.cs index dce562e0fd5638..c108ef12950f46 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt16.cs index 48ed6feb4dc552..c0697cd97338f3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt32.cs index 78e5a29e6a826e..eceadd5b734a73 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt64.cs index dc91bc4d3fe2e9..61bf95a0b5cdef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Byte.cs index 7ed248da06aa1e..6e27bd4adde6e9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Double.cs index 87eabdb285bc59..77a2b22ec30ad9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int16.cs index 00ab0c44e945f0..e01b978fcc06a7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int32.cs index f893f922034aa2..d75845c291fbb3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int64.cs index d7cca68a17a402..06e546bf666410 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.SByte.cs index 23e1c771ba936b..f12c3ee40d3ace 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Single.cs index cb4d118ba3332d..747a675a7d1d25 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt16.cs index b8b63243020801..370ed656f7318c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt32.cs index 5de8ad866b244f..2b5c4278e36689 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt64.cs index 3c8923f45b6425..4cabfe5728c912 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Byte.cs index 42476f9f093ac5..059ddc54ab1f15 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Double.cs index 58b4d58c96a2a1..462861ed829bac 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int16.cs index 5cbf072ec61f7a..89192cdd81b8d3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int32.cs index a436d1cae29050..afb21231d46e02 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int64.cs index cc4121005cad22..4201bfde35f9af 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.SByte.cs index 44e59e292d32cd..ee8c2f0336d6ea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Single.cs index 78e41c042aff55..4c86893a72275d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt16.cs index 5e291ddea8b181..9a566881be8d2e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt32.cs index 651e8955802dd4..05699744ee453d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt64.cs index 30cb0565859c25..b4d98a64cd6836 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Byte.cs index 7fedef91550013..d55cebc34d151e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Double.cs index 95a2a47352ad5f..b48f6e77558dda 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int16.cs index 74ed11792cc684..2074950cfd9ed3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int32.cs index 88b7bcd69c57fe..c0d1cdbfb0efb1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int64.cs index 3e53cc554f1d07..38d5c71e6c22db 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.SByte.cs index e8c4faf4063ad0..a36b34a0fce2d6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Single.cs index 33babfea80a4b3..e5e97e57f6cb29 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt16.cs index 837114078130cc..8e5cdc6898879d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt32.cs index 9bbc83af89bbbb..7f85d68c1d070f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt64.cs index 3ca9e19aeebfef..c7580d0dacd5db 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Byte.cs index f863bd4c0476d8..cca8d46df429d7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Double.cs index 52242c91425982..98905e9b29b04b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int16.cs index 540b5ea23c82a0..5426194ef1311e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int32.cs index b8f4ac33ff2257..f03bad7f57ae94 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int64.cs index 252a1e59856bbe..4e9b4392bb220b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.SByte.cs index e5a124ddde1fdb..334bf4825abf32 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Single.cs index ddecdc738e3a4e..7f63e504b2ac64 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt16.cs index 8b13ab9e682c23..cd9237efd26e66 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt32.cs index 30ec242c39f00a..55ae21a14646e7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt64.cs index 65ca43388f2717..4c49781895df23 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Byte.cs index c6b556cadc168b..25b58f9102fe4b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Double.cs index 71ae12f2d39a1a..c37e36df9c1920 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int16.cs index 1be6e3665e4ff4..6de64be1232046 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int32.cs index 63e3e659a12da9..0d665aafdf8caf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int64.cs index f3ce682cf273e6..108c0db4adbdbe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.SByte.cs index c47a5ac38079f6..2b48650906b42e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Single.cs index 429e7bade15afe..7d2a51f06c9d30 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt16.cs index 33d4f13d82c807..8a42b982dc676a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt32.cs index cd25231e88cd53..13b71db2acf7e3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt64.cs index a252291b9c6430..a46bed0d790c7f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Byte.cs index 6818833570bd1c..982a6ff8308bcc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Double.cs index c424610011f41f..8cb755a2a1bb18 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int16.cs index bfae712c665e0c..9c67bdc2075250 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int32.cs index c26cc7312ed32d..b32d0f3d63f33c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int64.cs index 6916ef94a8aed6..3e46eacc9081fb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.SByte.cs index 86341f8db8f93a..9997fa4cbdfc93 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Single.cs index 7160aa2c6b800a..0db5f27b522bd5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt16.cs index 79eb51feb941d9..daea9002c054b7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt32.cs index 175c5a0aec0ec4..113f001c0e881f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt64.cs index 4e038662b6e5da..0ff4f547796a18 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Byte.cs index 8fe5169a4ecedb..2720e9958a7671 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Double.cs index 7325d475645f8c..b6e4efcc880df3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int16.cs index 8cdcc210bde7ea..f67ab27845ce14 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int32.cs index 21954f83671b06..f61f63a33bafab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int64.cs index 9bda565ce4d018..bb45e26781661e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.SByte.cs index ed05ab904414e1..1313b67ad9ce2f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Single.cs index 082e5d3179df7a..92399afabf3404 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt16.cs index 54fe52b63ca933..2dd67c0444e4b4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt32.cs index b5f2023379c8a3..3f541fd1d6f6cc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt64.cs index 08704453d342a7..46fe0dd0d41f85 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Byte.cs index 59088a81255270..e3904df4c9d758 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Double.cs index 52d289f06cdcb9..929957fe8a33a2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int16.cs index 7566eb2017051c..fa622244ef6de8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int32.cs index 16ec46bd3983d3..0a9c30f56fbf40 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int64.cs index 070808aabe4b8a..570111e8d5b2ee 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.SByte.cs index e3fc6efd3fb2de..2489f279e6222c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Single.cs index 44df205439dfd2..b5c15536333fbc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt16.cs index 21ef7141721dc4..f25f1d26126539 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt32.cs index 3d21b33af1a263..0e59d113615fdd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt64.cs index ace903676a0e02..e5bf17c5e9c170 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Byte.cs index 68bd20993b1629..9113af55e5faff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Double.cs index 93a51714bc2907..53457a93b502cb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int16.cs index 97755c3bb2ba5a..8a597c2bf9752d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int32.cs index 05c36d016cce21..2dc8105149f068 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int64.cs index 7d877850fbac0b..a7112c7b510a7d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.SByte.cs index 6b12825413a484..5c8409f6790810 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Single.cs index 529d10589f6249..6ecdb6f12df4fe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt16.cs index cadd411c5f5820..636824c1a78569 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt32.cs index 3fa31e9a899110..7eadfb90c3f29b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt64.cs index fd8cbaca04c023..15020035c56d86 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Byte.cs index 16b7542a253f13..7aa391cf2d9041 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Double.cs index d290aba66d7bf0..74525b2385d4cf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int16.cs index 94e33f79bcfddd..1d45cfef2fc7ef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int32.cs index f9a286d334068a..5e364f77d62d43 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int64.cs index 722d463f323704..68e5074d781429 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.SByte.cs index 2b7aa64c46d5a9..1bae7ea950d548 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Single.cs index 12320381e1007f..b0a6731ab08bb7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt16.cs index 295033ab714896..cbe154b5c24a0c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt32.cs index 7aa3c7a6568d99..f3b247120895bf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt64.cs index 1f3e66e03c81de..df1988fc9461d9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Byte.cs index f38db4e2f8bc4e..4d73d591e67ce4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Double.cs index b7d1a03b578a9c..45a28416982352 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int16.cs index cac37b488a2427..009f0b2f9cc3c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int32.cs index 7425a9b362e92b..774608bcbb677e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int64.cs index 2107c8dcb09280..bcc3acbcbce5ef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.SByte.cs index 6b5fb815c76fd3..96710c28a23b6d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Single.cs index fb4924f9e076b9..306b188c81846f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt16.cs index 66f8a60250c8d5..e16b1d59c8262e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt32.cs index 7ccdf40c3442fb..408749a97b0194 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt64.cs index ef883c39fd4915..673f84386daf09 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Byte.cs index 93e0d8323fb9b8..39bfaa87ffa59f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Double.cs index cb67ff99d20d00..6f5dd49803c210 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int16.cs index 33997cfec30791..5a0a36e05e371d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int32.cs index 6d4a6e218488e2..df62d304e46ad7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int64.cs index 91d6a069108077..c51774420ca02c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.SByte.cs index b8fefd66a9da34..f0c8fdf667b1bd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Single.cs index 39af8b21dc9099..b3ee3acba7ff24 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt16.cs index 7a124f3e3d2e45..2f6d484dfef3df 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt32.cs index b1704a9bdb7cc6..8c0c867452ffb9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt64.cs index 1778cf6c10b9b0..19179a860f9537 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Double.cs index 346726e6574573..0836a8b75ceb10 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Single.cs index 4ba1eb7d7e39ef..35a178122728b9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Byte.cs index 24a6c6b40ba61b..2ef4c02c359299 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Byte.cs @@ -76,7 +76,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] inArray3, Byte[] outAr int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Double.cs index d4f9bd7460cd85..57d8647eadebc4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Double.cs @@ -76,7 +76,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] inArray3, Double int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int16.cs index 92ff677716f810..843da6dfebecb8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int16.cs @@ -76,7 +76,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int32.cs index 3ddd8cd11a04f7..58008ecc0a9484 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int32.cs @@ -76,7 +76,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int64.cs index 7b9b2ed64b2df3..d7c48534bb1758 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int64.cs @@ -76,7 +76,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] inArray3, Int64[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.SByte.cs index c9080c3ec8a94a..e75a177bf78c85 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.SByte.cs @@ -76,7 +76,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] inArray3, SByte[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Single.cs index 9754e3070222c1..33c7e9a3226982 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Single.cs @@ -76,7 +76,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt16.cs index 2e061dc91881a5..60e8f6bc990d18 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt16.cs @@ -76,7 +76,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] inArray3, UInt16 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt32.cs index 31b5d20e9b8f84..a869f0d60dd5a9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt32.cs @@ -76,7 +76,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] inArray3, UInt32 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt64.cs index 01648a6d57c5d0..e18f43fd35f53a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt64.cs @@ -76,7 +76,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] inArray3, UInt64 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.Int64.cs index 1a3f89b9ff22d4..00152fcc325751 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.UInt64.cs index 440a82aeca0e26..2aa93b25f76d01 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt32.Single.cs index f3db85983518d4..21f057fe447cc9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt64.Double.cs index d3bcab2add0312..54305f6bbb008b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.Int32.cs index a37fca6560261e..008422d75bbaa5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.UInt32.cs index 90a02f8e7cd043..549998c8e64ea5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt32.Single.cs index 1eb80eb7c964dc..37ece50d0226d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt64.Double.cs index 58475bf75349e5..2a07c0f40ca4ca 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Byte.cs index b4d2dd0a9ef342..ce90736b848455 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Double.cs index 2bd32510e368c8..b3fd9df878fc39 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int16.cs index 206c85838b976f..e77672e7100177 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int32.cs index 38f155ca4a9132..bfe31c58e154d7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int64.cs index b13b2d9b29ade9..2324a34192d5ce 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.SByte.cs index da3d2cb419ff9a..d75ae6d4e02e89 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Single.cs index 6d52638ec86e97..2f61a1cacb3d6c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt16.cs index 7671bd45bcfd27..646b740c92656e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt32.cs index 5b0bc77ab26864..979b1f1451e46f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt64.cs index e53513ed46adff..a7197b3aadb7ca 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs index 088ca272e81cd6..048f964f45e177 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs index 40c543e620b9e5..76f31b0ddd9087 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs index 1134392b46a426..ca2c92720a76a6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs index 9f237d402c1ef3..1d29cb0741e8f2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs index b9166be7fc30a7..a13094419838d0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs index 7aebe23f0c1059..57b5732ff478a4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs index 187febd4bbf5cb..f6809a4ab2b073 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs index 87df544bea5abb..ebbd03623ff53f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs index 98b830c11778cc..115218d79fa27d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs index 505b2905102904..61f8ceac1a4a59 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Byte.cs index a3a1ce894a32f9..e1233beb988b9c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Double.cs index 924ad8e31001e8..26fa093fc65832 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int16.cs index 4b7e8d6c61c140..3ec546f6974d3d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int32.cs index a44bdd24431736..0e316894b72b8f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int64.cs index 924d6d6fa79ff7..3af6c40aa2e91a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.SByte.cs index d3dd7eb4fa5bcd..452c934572f330 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Single.cs index 2d30b524cabd76..eb54447236f2f5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt16.cs index 4cc76a00b41502..b6dd8330f18570 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt32.cs index 6c86253767d39f..93910d4b55da68 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt64.cs index 75cc06ebcfe43d..dc0f9b4ecfafb5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Byte.cs index 61a983d2c4fd7a..aa68df642e2e54 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Double.cs index 0686df81e35cf6..2a09e8ad9f4481 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int16.cs index b7317e3431ce0b..c19a3cbc631742 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int32.cs index 6d0b4fe6077141..1b5089621ba0d0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int64.cs index 647f15a568b7e2..e098f1b2ccb00d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.SByte.cs index 753c6befebf28b..f11beffd5d35f2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Single.cs index 9c39ad513a028f..c3e806e7a1ea28 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt16.cs index 8fc493b257ea94..6fc9ba1c740c6f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt32.cs index 5610196f75c76a..c0b8653046a82f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt64.cs index 8215ef1c1cbf71..07747c9e98285d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Byte.cs index b09fd63d57831c..75a676566e0dec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Double.cs index f05aade14b624c..83ff9fdc4019a8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int16.cs index 678d7bff0ffb90..2bc69e19f68d4f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int32.cs index 6a9dce995cecab..9e9a694530ac2e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int64.cs index 5c78645a75fc8d..e7ed20ebab1a3e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.SByte.cs index f451ba243bfaf5..aaf4c73ef1c7c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Single.cs index ca65656c534b4b..064da653d3e5ca 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt16.cs index 72682e2ac2709d..57463066db716d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt32.cs index feaebe2991123f..fad29292ba8c89 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt64.cs index 0cf237500cd434..bfa99cec7aed86 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Double.cs index 7708df47ebb4fb..9ad9a2e981ea12 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Single.cs index e1a06ee2bf7641..591aa0ed14f009 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Byte.cs index 05a3d4ab381f04..8a92f728a71e54 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Double.cs index 3dc6aefb8d0eb7..9e8af671c54c44 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int16.cs index b6639951b5e922..924621c250c85e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int32.cs index bb69465fa35f45..e003e6da23ad52 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int64.cs index 14999fa436d0d2..60c7158eef97c7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.SByte.cs index be6597f965e9b5..76f56aff2c0ef0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Single.cs index 1f949e1b3628d2..4ef5c335b4dd83 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt16.cs index a7c6998cef0e9b..f259cf7cba9f9d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt32.cs index bf1dec013bbab6..78fb7464bfe2f4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt64.cs index a6b4be04eb6e56..32640f80bcc602 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Byte.cs index 883ec42a05bc6d..aef11e782c2123 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Double.cs index b0b68148ad0f66..baa137a9728424 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int16.cs index 9ae7b2c7432cff..19b78c105f7615 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int32.cs index 758274c4559a39..6b9e6d29ce1cd9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int64.cs index ad0765a1c9770d..3e77806dab948d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.SByte.cs index 3ad126f0d543d9..3b86b90b3db4eb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Single.cs index 25a7278ba82f3c..7674c33087335c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt16.cs index 1c11ec2fc2b767..dfd8121a23a5d4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt32.cs index f263c7ce53d3cd..6e161ba7de0b49 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt64.cs index 90cf5ac739f629..dfdc70a9e405f7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Byte.cs index 02782c905518b3..955b77ea30e08c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Double.cs index 8cf519e714e6ef..ecc3405a680683 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int16.cs index df2f314d29c131..ba7473149c356a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int32.cs index 14a518c671f6b6..f8200d80755769 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int64.cs index 81be95ef318aa2..4ae138a01a5f2b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.SByte.cs index f66f66ea4c9740..288daaf8eedaae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Single.cs index c8951f060cb2ca..0b94e946d9b52b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt16.cs index 1b393d6a5c24c1..b68d18ed3777a1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt32.cs index 1256dae96b1d6b..950a3d329a9dd9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt64.cs index 7eb00f8a18ee1e..ffb4c9c4764005 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Byte.cs index 142a4102b33111..aad61250debf70 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Double.cs index 73ad65f4943b21..6175d28e2f1441 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int16.cs index 8bbae9593a8f71..7eca4e3822c5fc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int32.cs index 67f24960e3b906..f1d13900237b72 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int64.cs index e4d2df5693b841..122693d237a1d6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.SByte.cs index 7dc842232cdc64..00e25fd1150679 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Single.cs index 7ce2ec59ac65b9..87f2b429576aab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt16.cs index 11a73f9046b1c2..357abdca0ec802 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt32.cs index b581a229b65544..8291245df29b41 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt64.cs index d8c864d8741ea5..362e6fe2cc535e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Byte.cs index c129a15b3ab681..fa6909e899c505 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Double.cs index 7a9f2098573d1e..26042c59238ea1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int16.cs index 674a02de021cc1..c7ce02d82f5a44 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int32.cs index a6d2f9b9a06306..32f05046822144 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int64.cs index 48606bc998e798..c09b393c377cb8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.SByte.cs index 956c6e5669074d..5207edce4ef5de 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Single.cs index 5495b9447a815f..bff1bdcbfe7025 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt16.cs index e7ff0d596addea..756be87167c538 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt32.cs index dd43975b89be11..267dc277920dfa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt64.cs index c6d74738d92c2c..1517febd104328 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Byte.cs index d07081ee818e93..4a16a75660d416 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Double.cs index aad2e4ff18b64c..41a1fce2d261d3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int16.cs index cd1893a7d736dd..32cd9f4e16d813 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int32.cs index 2a22c8617e149b..46726381c2affe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int64.cs index 9bd6f476ec3ed2..fc25b03a8971a3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.SByte.cs index aa5a584ad94177..dc34f58bb066d3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Single.cs index 1c87deda320eb8..3ae45f190edf5e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt16.cs index 90e9d6025aba1f..106360a5c7c7a1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt32.cs index 00b4032dff3736..021afafe83b152 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt64.cs index 894a019ee84de7..377d573f82964b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Byte.cs index 2c05edda982679..67c1d61603010c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Double.cs index 5ab9b7019cda06..3101f963168c65 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int16.cs index 55df6d12474bbf..d0ab0b34eede3f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int32.cs index 0c2a08efd5103b..83e395bcefded3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int64.cs index 2750110a4f5750..048e2ca724ad34 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.SByte.cs index 10e9b7fa863a16..ad3b13bba4968a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Single.cs index 9bcd961fc470d3..41324a3a854a43 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt16.cs index 1e3c6a7cb8e9d2..902fae175da567 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt32.cs index 4396466509e147..b53b485aa87748 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt64.cs index acbea1d3c09bea..79d36b5aa25749 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Byte.cs index e5002eef6a9677..dd0ba62ce64791 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Double.cs index 156ce31595a331..2c8a78ff71a362 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int16.cs index b68ab448ac22fd..319602d129d091 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int32.cs index 1e0a73d8961f77..ab25c55abae527 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int64.cs index f96b49696810ba..68d096ebede374 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.SByte.cs index 3b2e360955cb32..2c07ba25a60719 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Single.cs index ed698a3a30a5cf..054c2169b97190 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt16.cs index 262077b1bc7e7b..f4fe74d0a62233 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt32.cs index c746cfe223a109..b0ef11d84ff6d4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt64.cs index 49d02c5343f73b..cfad7a0af05db4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Byte.cs index b1e32541d14145..4deb0719079493 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Double.cs index 1beebdd181cb6a..b27eb422210e1a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int16.cs index 20a2ff0e304ca5..81be2aff20f9d1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int32.cs index 54760ac8428c65..577395c0561179 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int64.cs index cac0d6d9b29db8..d656bb4322b018 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.SByte.cs index 11dddfbc7094d2..43a62d7206bde0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Single.cs index 43a3cf4b070498..b05078bb9da54a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt16.cs index 5e11badfc11500..080064e390a58a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt32.cs index 7a1d20eca54e76..40a5327d0d6f68 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt64.cs index 6824ee285d88d1..6a5543d32e76e0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Byte.cs index da9e348550c1d1..ea80bb82a443cb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Double.cs index aa5de18291169f..eda5dbcfcd5398 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int16.cs index 203c60a3f0fdad..e3bd8e61f75202 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int32.cs index 333ce1c104b1af..1a464d42268324 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int64.cs index a2da0d434667e9..cfa1fa93b02c76 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.SByte.cs index 28c2fe534e1c8f..fc0d15c2bd0cbb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Single.cs index 2e5941c8c9eca8..4c111b0cc0b142 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt16.cs index 67a80b54da32ed..fc3f971446d290 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt32.cs index d44601ab4293a2..35f321b4bfb1fd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt64.cs index ebba9c5ded1545..93f479ce9ae08a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Byte.cs index a680c30e760d1d..fd7dc6dff53bda 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Double.cs index 56d6917ba9b3f2..e11c655c954a63 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int16.cs index e688bcb3ec33a1..34a76b550d955d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int32.cs index eb6e13a5575f58..436ff10f0c2e2d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int64.cs index 37dd238d04c9dd..6cda3162a2f2fe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.SByte.cs index 3fd706d8d53fdd..9c9d03928e865e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Single.cs index 5393c7d2f49269..fb2cffbc5a0b69 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt16.cs index fb606d05a5487b..4df78e07770d71 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt32.cs index 3f1f9bd397255d..249565ea1fcd98 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt64.cs index 8d2aa99d5511a9..89d74a97f1284b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Byte.cs index e301098af409d2..6a36e84b42de4f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Double.cs index ac8db446b2aacc..150d53244f20bb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int16.cs index 17dd051ccba844..beeb37e7031ac1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int32.cs index 5a3aeac2db3deb..3ef87ac4f85f04 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int64.cs index 2ef4c136749858..48098c85866961 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.SByte.cs index 65cfb425b67b56..c4c59be579bdf9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Single.cs index e22616dc026144..26613cdf1dbe18 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt16.cs index 5baa7c6865e794..663390f919ca22 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt32.cs index d4f033cf3df71b..37686e3b8db7a5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt64.cs index 5938d0992a6468..5e347c53306f27 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Byte.cs index ea82fa9a6850bb..7b46294d433e95 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Double.cs index 16b7e3009fbb41..5c7fe6874cbf9b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int16.cs index 76e9a2b38d1e02..a2426a499f2490 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int32.cs index 0dc66d2fc3b5af..459ef172d9b4d8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int64.cs index de67ddd22874e6..b78a89ada2e6a5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.SByte.cs index 80582b6c8c402d..e02c38ac420f89 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Single.cs index edf37655b551f2..2e8662dd82dcc4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt16.cs index 85501635df32bc..37da67740d7d68 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt32.cs index 466e702348694b..71957b52a49fba 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt64.cs index 34002b91a41023..300a67eac78ac9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Byte.cs index ce011a8ffbc350..8dc93ba66d11ae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Double.cs index 469959ed797cea..3f9a48953fe195 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int16.cs index 086774a6022ef9..8b374635d7482c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int32.cs index 5b6655b9f7e571..66fae0a903000d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int64.cs index b8e2e59f80af69..8a8490728f5093 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.SByte.cs index 12dd6d8ba53fbd..bcbc5a6ac24cb2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Single.cs index 58e46d190d9688..8a919ed075f387 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt16.cs index 4e4abc54902b67..e0101b32e32252 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt32.cs index 3920c0127f7c99..b3e3de31a219b4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt64.cs index 33c214562ca8e8..ef2b6685590b64 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Byte.cs index bcb949431bbabe..66c263d6777de7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Double.cs index 871393b1d4a698..2a2a2abbc6f6df 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int16.cs index b7c817486ab880..7ebdb7e6d0889e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int32.cs index 0e1faebc79dac2..7a0ee59f063410 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int64.cs index c17208bc2464f6..6e4bd1b90792b2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.SByte.cs index 71477230b572cc..d48ee35e0a8775 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Single.cs index 1a61ce2fd36280..e4a7c4855807b0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt16.cs index 73c022efec3df0..c871404d142eea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt32.cs index d49718428bc0cb..c35ae2922d6801 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt64.cs index fa058b65bdf7f6..a056fdf1ea1c8c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Double.cs index 897eece4c60078..bf794aa1e4426f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int16.cs index 4a959f6f1b2a09..860ecb7ed384ab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int32.cs index 63dceb56dc179e..c07db094754a5c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int64.cs index 26f2328367f5c5..2f465e0601fede 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt16.cs index b12bb2f28dccd1..da2eb839a3034f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, Byte[] outArray, int alig int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt32.cs index 4cb3ab9b936fe4..e6555866c886d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt64.cs index 7a6e2bcae32b05..064ec712a2b904 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Byte.cs index ff660a263e10f3..e75c6b097fb6ba 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Double.cs index 14402a47e82bd5..87e2df6664a7ab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int16.cs index ac13b667aae5bb..9fe3e8b3e5364c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int32.cs index 9d243b7ec9abf6..de52dab5a503c3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int64.cs index 0f9be7e7e129a3..b3e5b241945b8a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.SByte.cs index 99d9ee01b375a3..82cf8cd256c63f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Single.cs index 1451980891848b..01d789af0fd04e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt16.cs index c57dd76a6e3520..7274e5ef6cf0ba 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt32.cs index e1ed17da6690e3..599699b48dd9d0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt64.cs index 27f895f559510e..73fede7f09ba23 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Byte.cs index db267f30b32e93..415b1c5e07bf2e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Double.cs index 3d055ecc384938..cbef5f9def7ef4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int16.cs index 96483ff27e92ea..e43e2840ffdbaa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int32.cs index ce10c11f6f31dc..62df33635887a8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int64.cs index 3f9be85bc1577a..7992189846a52d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.SByte.cs index 62424ca9fd9e8b..77110a5b7354c5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Single.cs index 985be58c1655ef..d7bc575cac08c7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt16.cs index b3137940594feb..ace05e29439e87 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt32.cs index 97e5fb543410e5..176c13ff452878 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt64.cs index 0019d7ad6c1398..76f897df30b361 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Byte.cs index eceaffd586cd3c..a59033003a61cc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Double.cs index b49b88b790c574..176e302524dd81 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int16.cs index 265256355cf8e4..42939372c14dd2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int32.cs index 370c7b9208878b..4e55a1e8f51cb3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int64.cs index 57e4739a15c0fd..2874e0391f7273 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.SByte.cs index 0672f5cdf52511..fd33fcafd97c20 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Single.cs index 99c5d52fc6088c..cae12d1bef00ef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt16.cs index 30623ee9ae6c82..8cbf29c9b52205 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt32.cs index 4fb0b7f5bb78f7..9a61de2c2d3456 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt64.cs index c098760a8daeeb..5772ac4dc7abdc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Byte.cs index 3943e8850413a8..e5026dd1e159bd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Double.cs index ad0e9bec500d7c..1baa057b9d9c65 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int16.cs index 08fe30a7cda413..ca8d804f3cf797 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int32.cs index ed817a53c23c26..6138f9aa1905a1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int64.cs index 948113f8af640b..76e9af39bc00ce 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.SByte.cs index bd6240338fa875..93aa76ed808dc4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Single.cs index 61767423d3ad6e..05bf517b6523d0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt16.cs index 74654926db77a7..2c4419dbe93d3a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt32.cs index 51564986fa721e..86572829cb6a07 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt64.cs index 595ef7c3683881..39ebab11bd3525 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Double.cs index bd3af6f98e8213..32f3ee39bf1549 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Double.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Double[] outLowerArray, Double[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int16.cs index 57b638e50acd3a..8ba2ab64bb0cc4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int16.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, Int16[] outLowerArray, Int16[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int32.cs index 30408c1a2b7cb7..939c91f5b343a6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int32[] outLowerArray, Int32[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int64.cs index ce71edcead5bbe..5ec3c7c73bb45b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int64[] outLowerArray, Int64[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt16.cs index e06e628e325502..a668afb9c77c89 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, UInt16[] outLowerArray, UInt16[] outUpperArray int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt32.cs index 9a06f3f06f358b..84d7515441168b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt32[] outLowerArray, UInt32[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt64.cs index b5c3c023b92dea..b4acabd2d061f3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt64[] outLowerArray, UInt64[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Byte.cs index e82be743803900..16eb68e80e2d2c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Double.cs index 0bcdd8f3daab9f..8f66ac14446117 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int16.cs index 1e442bc52801f5..dddc72db6d2404 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int32.cs index 626d36e40d7a0f..4c9ff95f42f1d6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int64.cs index 87a1061e29dff5..a03e5edcc4cc32 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.SByte.cs index 08e0534a7d42b9..db14dd6b1ccab6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Single.cs index 9af532c37747b1..4f18ff114eaebf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt16.cs index 8fcc1e6dcf0402..398e4d794d059a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt32.cs index fbed449d715860..a777992757faa9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt64.cs index 24eed6dd3f041b..65f9f83e892c44 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Byte.cs index edb1bd145e2744..0447d1fa704cd8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Double.cs index f5b228794fdc7f..4eb227df886dec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int16.cs index 884be13c44bcde..d63d7585d5249e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int32.cs index 2902af5dd77023..459c40919c4f3a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int64.cs index 062d0ad548c10b..bf33c287efd318 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.SByte.cs index f959ec23b5a5b8..77798dbe9a2070 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Single.cs index ea71781710cbd7..a54a88bbd39c7f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt16.cs index 66877780897fe2..e662c788b66aa7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt32.cs index 5b90c1e99228e1..2ea71d97552e4f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt64.cs index 60d83da100949e..b914a0ea2d7633 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Byte.cs index 9123dd4ddef7bc..9f2138731929e8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Double.cs index 7d172db1f77a44..16699d47d0551e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int16.cs index 98c595e95d78c1..b91c75ae7dd97f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int32.cs index cb7eadba54ae17..4dc09dba0b0583 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int64.cs index 68763d5d710ef0..43cd7b8e61f89f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.SByte.cs index a3b16fe5b23434..d305454e394f93 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Single.cs index 72987f8d43666c..5caad1f3889655 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt16.cs index 5a80c970149d83..81e9ebe1c787ef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt32.cs index 47045dcc4da642..6a920bd4d33575 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt64.cs index cfd8947eae9cf1..2b1234630a6ac7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Byte.cs index 72b8e9634d1bf9..b1e0355cec0b1c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Double.cs index 5005079e705365..7e4ad6c75ac103 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int16.cs index 644a5b2fe5f72c..23f9027a09caec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int32.cs index a946ea638aa8d2..1ea8f8a06f1eb9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int64.cs index f86bb2a2ad3cd0..12d91351f175c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.SByte.cs index de2d91d29c0d10..8daeb6adca1908 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Single.cs index 39d0b2d7bba416..9ebb0d674c896b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt16.cs index 7fb2d0a2eab3e8..dcbd12f0ec6c3a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt32.cs index dd7b66c8bbcd08..634880950b960e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt64.cs index 8be92dfc997af9..2b48db2251aabb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Byte.cs index fc4e5d8c4c7fc7..969f1e50321ce7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Double.cs index 69ad39457c6689..cbe34d206d3622 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int16.cs index eebdbefb145809..d476ffe0d98a3f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int32.cs index c6aa084b9429ed..6e7fa7059d9d7f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int64.cs index 78a2b9b8e000ad..15e4f47c56024c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.SByte.cs index e0f1a74de275f3..b4af45b1d23df2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Single.cs index e2f95534b776ac..551bfff1e36e42 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt16.cs index 8b0dfa8c69fe80..1199ad63cdb9d4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt32.cs index bdc853ad0d7d66..0d74e0f700008e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt64.cs index 6e99e2f4ae3b52..841ba28ad471a1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Byte.cs index fb0a1b9650488e..3e55b760f08b52 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Double.cs index 4e5a72ee5e18e4..88fcd008bce7b4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int16.cs index 8ceeac47680147..bef9ab1a4705b9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int32.cs index 8c9b5a7d57d7bc..266cc33fdd8bde 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int64.cs index af2f5f7288e6ff..464c8dc3aa6f48 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.SByte.cs index dcec37c20bc094..2c10b3df229227 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Single.cs index fce65a0e4d3834..54a731f3326d43 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt16.cs index 4fd9eeb8d03964..ffb6bbe9ff7bde 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt32.cs index c13c1b87a0364c..4267ebf60b5a7f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt64.cs index e88699587cc9d3..d21a1e50288356 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Byte.cs index 5628bd5608384b..7347e0cfcb7936 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Double.cs index 1a2ee590e8781c..50a69cbf99b8f0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int16.cs index 0db5f33afe9f89..2e89f2c330ceb0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int32.cs index f6d167cc68d36f..38cea11a19d84a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int64.cs index 025e314b40b588..ab52d96c5a2469 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.SByte.cs index 39305e86a11039..d3ca82f3ca9205 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Single.cs index 9b0cc58cc79ff2..df4f9549a1a0f7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt16.cs index bee3a9eb4717a7..8f4f69f15b5a2c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt32.cs index 2a1ab8c13fa95a..99f484cb66bd62 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt64.cs index 79f47a8b143bcf..ba0dd1c078dab1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Byte.cs index 31702e5b290a35..25834838d9ad29 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Double.cs index fb7ad7442d1974..e6044687f9bb11 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int16.cs index f4067c62922178..c3142804265ac4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int32.cs index f66c44b979e899..d8fc09f3c4626d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int64.cs index 94dd5711b4d3b7..ce5e5368b8157a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.SByte.cs index efef90b2a7eb36..721240fd4d7ff5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Single.cs index 3c03668833f8b3..c2ea914a7cc617 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt16.cs index 9b800133a694dd..74711dc2cb454c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt32.cs index 398218f2083b6b..e080982400524b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt64.cs index 81a4da0ef539f6..be589ac07d7d77 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Byte.cs index 1fa988d86d07b0..89889121ebb34d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Double.cs index db90892ccc2f7a..8325e02b27b6db 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int16.cs index b0ea2bb00dc535..f0447e4048b628 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int32.cs index b976dc7d66eace..329d4ef32d9abc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int64.cs index ae7070660469d3..79f6468f6ecd3b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.SByte.cs index 221c1a5aab62b8..e50238b9619bb5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Single.cs index 134d7bf46f2c3b..688daa40abf805 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt16.cs index 505a09ae7d8aa8..60e85d3aa5ba5e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt32.cs index 4adcbc859506e5..8b9f3b023462d3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt64.cs index 2abf0f52f48373..3d535c26b96eeb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Byte.cs index 22518139230028..c1445d4e502671 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Double.cs index badc5e7812f7af..ab63544b35485d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int16.cs index e95053369c211f..46a4acc1163e0e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int32.cs index c3d526b96e6ad9..479cd6c6b95920 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int64.cs index 7239141cb4c194..043a894d542411 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.SByte.cs index d4d9c472239b0b..c92191eb36d083 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Single.cs index 68d046a568e768..2248c057bbd1cc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt16.cs index 3a6331a12988d8..c67aa416a77aa4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt32.cs index 9ea80e08a99fb1..073c6534931570 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt64.cs index 7079c2fcb3c328..ffb9517b946acc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Byte.cs index b7cec03a716a4a..847d143cefffa3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Double.cs index 0cab1a1dbc103e..505aea8f9a9654 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int16.cs index f7ca83717a2d4b..6a989e68102563 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int32.cs index 065b63665753d2..e39d68813657af 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int64.cs index 35f4c57d64a030..d8587ebc709b4e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.SByte.cs index 7baf14bbb5baed..63759139d3b893 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Single.cs index a43bea91dc05b2..c21338aa31acf6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt16.cs index 6b1abc29378e7e..860d605d9a4c62 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt32.cs index 0725520232fcec..7eed55483adbfe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt64.cs index a9c9f0d8a1c184..ccecb61562ccf6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Byte.cs index 32ec7fae73456c..1a87c56749c838 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Double.cs index e9e93e36496ed1..8c87c70f2f41d1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int16.cs index 3218dc001f5101..89c7b63d049636 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int32.cs index b70d3ca755a873..9afc94cbd775f5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int64.cs index 8d4b3bb16b8f18..9f867f9228ee65 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.SByte.cs index 4e63922fea3283..d3b0408e206c4d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Single.cs index 0b512af36de379..6bdd38ac8c8ed8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt16.cs index 3e7ac0f6c91786..f27b805624b20f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt32.cs index bd4dd1c8f90f3f..8dc2cf271e41e6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt64.cs index c07ea142d03c30..e585bcfc5c274b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Byte.cs index 62116a806747e6..a8a4592af836d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Double.cs index 00408af5f9dc23..00d5e428420cd5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int16.cs index c6355435e504f8..fd7e68fb0aa79c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int32.cs index e892ed1f309def..9b4da2b316b4a6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int64.cs index 336210b9147531..ce26af3f422065 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.SByte.cs index 11c63d7cfdb888..1929f7c55f8b68 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Single.cs index 204c9ecf2c8453..1f93f4e39f2e39 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt16.cs index 5d3b8b280caec8..6254dd5323f57f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt32.cs index 3d23e7a230d0d8..220cc30360b4bb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt64.cs index 7ced9dc59a6d09..3b44d959099e24 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Byte.cs index 53fd29ca7b3b33..2cf2240d484109 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Double.cs index 28fecd34942121..61470bffa5bfba 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int16.cs index 2ef8607fb06137..c20161f479ea08 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int32.cs index fa3ab0fe1a1363..8182155bdc424d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int64.cs index 1cb876cd0465ee..c6bab7b7f8cbe7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.SByte.cs index 2b540c69fc7232..9ae9433f4d275d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Single.cs index 892dfe6a496c79..ca78f03d523a75 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt16.cs index aec4ee3822c491..854bc20876a442 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt32.cs index 14439fcf8d01f1..443821407cf1bd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt64.cs index 69c4253588dffa..dfb1b928764e16 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Abs.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Byte.cs index 80f7ec1eb52b5a..14d41a624f1828 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Double.cs index 7909dc8d7fa8ab..df901472e97813 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int16.cs index abce6d92af6341..575aa9ea2b9e99 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int32.cs index ca28b59145599c..9c1273e8088475 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int64.cs index dbfbab7617592a..556b4c71688715 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.SByte.cs index 0b100227b8754c..38ba43008896bc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Single.cs index eb11f4e990f79e..2dd84cbf48a0fe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt16.cs index 7870243c81b61f..000a6038edd979 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt32.cs index 5117ff5d0096a7..956afff2c57c37 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt64.cs index 9754a66594014e..546b29c4fb4e9f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Add.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Byte.cs index 696760c0e4c806..9cf1ce136fab6d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Double.cs index d8b22af648f0d8..8fc157e8eaedee 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int16.cs index b2bff5efeaed15..29ccda12dadb07 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int32.cs index f64c6c1c76b2c8..b33162527a0e6b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int64.cs index bb79866b786b1d..368bee56a492be 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.SByte.cs index a90d6fac9189ae..89de83961c0fff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Single.cs index 77e8889a4612ac..7741502f152f7d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt16.cs index ce55bfe8344b7a..0f5d448450c4d7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt32.cs index 1aa9dd7f694327..9fd83a6cb153b2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt64.cs index 4601cea7da19f4..09bffbbf7e6265 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/AndNot.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Byte.cs index 5fc4d0f4547104..851c85d9c8b5b5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Double.cs index 07a9165940d21d..71ea871a21a69e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int16.cs index dd9a8625e12c0e..c26d66b7986c65 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int32.cs index 15c22e3db2c9ce..3384ef108fb213 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int64.cs index 0583547c4ec8ec..0eb5ed4d54c683 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.SByte.cs index c01be7411e7c40..c8e2297eae76b1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Single.cs index 3d8b29c5e17e16..32a92e6e808e89 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt16.cs index d92c07056d5473..af3cef68ce3dfa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt32.cs index 443636df24e3b1..18e87beba1fe5a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt64.cs index 6bfa82d839e621..dfb4565013e6c5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Byte.cs index bc1b5114c24bcb..8c1adaddaf412d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Double.cs index 7c8021763125f5..6fa74f57051598 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int16.cs index f86521f49cb3ea..f63ba2a7e98ad8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int32.cs index 12f6ea9522ca3d..70555161228396 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int64.cs index e9c6e6563b992d..358b3c2230192b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.SByte.cs index 3a416ad2c07a7a..745d1c5f15d974 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Single.cs index 508f09971cd1d2..2505a44cb3c71b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt16.cs index 5194a549cc5c4f..7cf0b232899052 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt32.cs index 5eed6842c8e26f..04fc238eff042a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt64.cs index 3421a919da6b28..a908385ef9ba94 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Double.cs index 79d405997626ff..f987ec6f28e3b0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Single.cs index dcc7e9f17b7883..93513d5d1b72ea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Ceiling.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Byte.cs index 453b41c0c81986..16c46cb9412132 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Byte.cs @@ -76,7 +76,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] inArray3, Byte[] outAr int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Double.cs index cbb8c4d9ea1c4e..efc176089b0f72 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Double.cs @@ -76,7 +76,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] inArray3, Double int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int16.cs index ab0c2203d0892b..1ff2a1e2adb116 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int16.cs @@ -76,7 +76,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int32.cs index 27baceb6de26e7..499f77e7b91c40 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int32.cs @@ -76,7 +76,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int64.cs index cfb07bb5cd06f1..c11497611efdd0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Int64.cs @@ -76,7 +76,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] inArray3, Int64[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.SByte.cs index fe826c9b8a3aa0..43ccd8042e3697 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.SByte.cs @@ -76,7 +76,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] inArray3, SByte[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Single.cs index b60f30f87191c4..f8166cdb64ca78 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.Single.cs @@ -76,7 +76,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt16.cs index aab6fc6e7a4513..9a0ae7ac443044 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt16.cs @@ -76,7 +76,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] inArray3, UInt16 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt32.cs index 168c659af2d1eb..72fe0f438ac488 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt32.cs @@ -76,7 +76,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] inArray3, UInt32 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt64.cs index b008947be4a002..8f586ba089d9e7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConditionalSelect.UInt64.cs @@ -76,7 +76,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] inArray3, UInt64 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.Int64.cs index 58981d221b15fe..267226facd17f2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.UInt64.cs index b4e43677b306c5..aa83b90be15c41 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToDouble.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt32.Single.cs index 3d884a291aa7f0..b83d0f570dcd07 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt64.Double.cs index 848635c9854938..b0a400fdc8bdc5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.Int32.cs index 26c1649981d34c..e6162393fdb04c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.UInt32.cs index c735c2001f5cc9..d830eafa6d9c59 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToSingle.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt32.Single.cs index d74b02f65fe720..d57396ec44aa19 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt64.Double.cs index 52e88cf64c4564..ff4fa8d55af6f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/ConvertToUInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Byte.cs index 11f738abd2e257..93d82bdf6b61c5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Double.cs index 303088eab4f7b9..a8ec26bb531455 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int16.cs index fabcaa1ddc7f01..dd8163c595749e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int32.cs index 88899c3f777993..4eadb9bc2af431 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int64.cs index e5ceddc1586eab..04755b4c777872 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.SByte.cs index ab21a2e38f622e..32d2d2ec101e85 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Single.cs index fb8b9cf0e1fe72..b006ac181e42f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt16.cs index 17d57c981321db..6edaa752accc43 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt32.cs index 944d5dc5af7c93..04f00d15ec9941 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt64.cs index c4252cb7dfe6c9..a8cbade4493dfa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Divide.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs index c2cb61d0e87b27..1a96e975ef97e3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs index c8ae4ab88b5d38..1287239b06632b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs index 2341d2edb67832..9cfca7c28b340b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs index 0bd28b993e9f13..f6ac8d34be0b19 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs index 2352b6db132b87..8cd93b0854ee33 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs index fd38aba7d8f2fe..fe374c17133d06 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs index 9808fde0a145a1..fc6cf030c14ca1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs index 824ea0b9a64e7f..29c28479e69006 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs index bf3d0ab7053649..c9be5e3ea98902 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs index 49b27f6f590723..556d8019c33180 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Dot.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Byte.cs index 0bb2e64b1004ad..cdb2a224909526 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Double.cs index d195545b28b938..92c9d5127c4347 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int16.cs index cd4ea1bb5b939d..505049473d413f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int32.cs index 11db21a5514c92..ece0062517379f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int64.cs index 4bc7a0ccff7028..712d6359704bbb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.SByte.cs index 191cd061f4c7b3..b682923d842254 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Single.cs index 10544d64409d67..29251c0b5a807f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt16.cs index fe3117e17e45d1..86b9fa06a79e92 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt32.cs index 56e0ccf23a23ee..e7439a509063d6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt64.cs index 95be9a2aece25e..6262624a9e0bfa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Equals.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Byte.cs index 31dd5b2152512a..a9d79c268d42dd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Double.cs index 0318e77769f243..9364152f6bf1b4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int16.cs index 69ce0314013281..969dfca775518c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int32.cs index 6cd8014fc972d5..d986985a3bb677 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int64.cs index 468ed4ab70e7ea..d1b0f12cfd3be0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.SByte.cs index 8cb00fb65308a4..bb9ed809713d9d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Single.cs index ac63d0246c8d60..c907bcb550208a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt16.cs index 61d120c5a912dd..6512b6b755e3df 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt32.cs index 175d5574d1d95c..e948db07c1e15c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt64.cs index 86374f114a7c28..8f3aec09b9c099 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Byte.cs index fe18fe2de64f06..79660a5be2673e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Double.cs index 21126ce8e55a8a..d999a05d1f871d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int16.cs index 7656c9e2a32799..6c001f36be8413 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int32.cs index f69ae3a24dbf17..4d5199362fe9cb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int64.cs index a32757602ee8f0..dc18742f8dd2c3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.SByte.cs index 6f4674fb7e2aa9..fdd5241fb6062b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Single.cs index cd8e55e91763b3..95d321042c57c6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt16.cs index 7afca914fd733a..f5497713b09bde 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt32.cs index 9c61a29d2dee7f..1d1e1b8499f3cf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt64.cs index 243f130320482e..9460defbb3bfb5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/EqualsAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Double.cs index a8538ac06dc7d2..45022063143be3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Single.cs index f546b0042c78d3..82b1d3f16da72d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Floor.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Byte.cs index e07db0f411c914..2e432f6613834f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Double.cs index 8bf75e468925f9..70504b44207c1a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int16.cs index a7e22e0254c02a..5069db7aebc460 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int32.cs index 7ba404cfd34c0f..6297fe5af41857 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int64.cs index e664e86f337a24..c38fdd7fff6ee2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.SByte.cs index 47bd0810f50e0c..d5c9a683920c92 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Single.cs index 710db523f955bf..22f957b21b13df 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt16.cs index a18b748bce8c8a..8caf89e3abba96 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt32.cs index 22c1145120cb59..ef8c6d22a0c7b2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt64.cs index af4683c81e9db5..e8a4b759799fd1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Byte.cs index a1f0cabeaaf154..ae3fc5b62ecdcb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Double.cs index 160d3c9230dcd7..5fa11ec29a4f67 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int16.cs index eef73dbb900d8b..8ec47767bf0177 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int32.cs index cf19328a0c9996..e76a53eaaf2401 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int64.cs index 42ce9069f03877..228c2ae52648b2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.SByte.cs index 373b0950cb0a57..8aecd9710fe3e7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Single.cs index 45d15d6e7ad9ee..8ed9f365480ecd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt16.cs index 17b8c9b19f3249..6c3fdd044dad39 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt32.cs index 21044bd2d5d179..660f7d7e76cb9d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt64.cs index 6e127c3deb7153..44d1e59746f754 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Byte.cs index 51092989c55bbb..0e42b5572943e3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Double.cs index cc02d6676710c5..ba96a73ef9e1e6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int16.cs index 8803f95e65ad23..8b16f9d04fc6c4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int32.cs index 5cdf69363f6aa4..697f165467a4b1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int64.cs index db7e6eefd90e68..5d533729af7b41 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.SByte.cs index 3f611b89ac9580..229380cc303afc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Single.cs index ef6d14bc583d57..2f73bb1231a009 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt16.cs index 544958e2f033a5..a54858d8fbd4e1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt32.cs index 703419989328a4..505c1d71b0d1ec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt64.cs index 23f8583b4584da..4fbfdc67045d35 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Byte.cs index 7ab2993e2e8aef..50f3084e545433 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Double.cs index 8808e71dd3cc74..3a4fc4cb213217 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int16.cs index bd67f9549e7686..08f4414fb5582c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int32.cs index 6bc5a5b4fb3eb2..b51b8e7624be7a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int64.cs index 071888fcc4c941..f3c10025af0428 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.SByte.cs index 8f3bc97cb8bbf5..517e71b94f4eaf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Single.cs index 3359375b40909e..abb18272af5b4d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt16.cs index de075f82a459b3..79231393caefe3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt32.cs index 02626333b9e5f4..69d5f5c52782fb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt64.cs index ca7895384f0bc9..14dcded1a26d1d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Byte.cs index 6017d8a3c0255c..aafaa1885947c0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Double.cs index 1b9523949b2468..d5516e1cdfa7a5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int16.cs index c0d85d599af2b5..1fd24c39249e5e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int32.cs index 55dc759302c945..9cecd2cfda48d6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int64.cs index 95437bed07b083..6880c01b409098 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.SByte.cs index 80f43a5756329d..6a76e47a516ef9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Single.cs index f96bdc0373c447..214bb2784443c6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt16.cs index d409e51f4931d4..5aea199c3c9060 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt32.cs index 0a90fb6177e0c1..7c0a0736163691 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt64.cs index e2a27e6c99d44c..6e279b9712f9c9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Byte.cs index aed5aba1dc4820..74555589d3d3ad 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Double.cs index ebf60bd8aee5c2..40bda60357839c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int16.cs index 48f580bbd665a4..e50b31e7d85d30 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int32.cs index 0ce3fa37190116..026f26b480b461 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int64.cs index 75360de4f6c1c1..e7205e1eceebdd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.SByte.cs index 072fc75361bcb9..1838c86b4958be 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Single.cs index e061230ef61aa1..577c14891b75ab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt16.cs index a93bd5be549395..387d2fa384f644 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt32.cs index 8e1b7c99d62a2c..b435b176afba01 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt64.cs index 3fe989a7d4f753..56c0ee23b7b03f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/GreaterThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Byte.cs index 330de230deb6f7..a577748977635e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Double.cs index c73a9508c0f03e..c33531d4e025b5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int16.cs index 934bb9328e60e6..44bd08df005ba8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int32.cs index 6b9feae359e250..b4ad21ac9c6312 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int64.cs index 7f78349215d5b3..753c29227eda23 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.SByte.cs index e757ad43ff6a13..cb692a8d5c08c8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Single.cs index 651482461eb9a9..65d1d3e3fe0cb0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt16.cs index a437699b7626d6..c0b16da333b64a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt32.cs index 015d7e8a4053a8..2c26ca74005a16 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt64.cs index aef7234a74ead6..51ddd6896247a8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Byte.cs index a758732224b8d2..67d753aab6eff0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Double.cs index 462bae410c4aa5..0267af1418e59e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int16.cs index 92239a354439ef..0a80f2b71006c0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int32.cs index 098bd3056b64a3..9c1413de1697ac 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int64.cs index e91879d6411758..b22d1bb223756c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.SByte.cs index bb3c8115405f9f..6e04d7e623e984 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Single.cs index 8ef57871b96813..9ecdcf7cb89a56 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt16.cs index 33192ecb77bf77..3b32a20a64747c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt32.cs index de60214488e14b..0155be6de7fe12 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt64.cs index 1cc719ad745b65..e4d856efafd4af 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Byte.cs index 32936f041ce6aa..bfa72cf5d7201c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Double.cs index 667ed7fbc64e79..b1c9da9e4af30d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int16.cs index 2d7f438f9a46d1..60e7d605d842f5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int32.cs index 3ad292b50e3c23..7e469ae11c8f4b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int64.cs index f9267a1fb9b2eb..1866b2dc35796b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.SByte.cs index 91be58e789b33c..96bcade991ba2d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Single.cs index 6e2cf24c3ad5dd..adbf70276917c3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt16.cs index ae3b3f3559f9a7..ac35f2c7973f9e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt32.cs index bec918ef08d508..cd4415f29dd896 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt64.cs index f4a038c77eadf6..27266ffc7df05f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Byte.cs index 53fea3c83dc8dc..b1856f49b30f69 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Double.cs index 16c99b6f6ed364..973100cd0bc0e7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int16.cs index cf9728567bd25f..34d4c76116020e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int32.cs index 534065e5d81dc4..105d14c3149bff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int64.cs index 55100ad80f0b3e..cf82333577ff0a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.SByte.cs index d553135b581518..4dd3709857975c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Single.cs index 9959fa6fb49f9c..315396439d6c46 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt16.cs index 2391ac35f93b45..e3a4a98554e9b5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt32.cs index a4b2dd76350649..a4050b0537e90f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt64.cs index 6b3868b24409ba..b649326adac9c3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Byte.cs index aa31ca62f6470a..910ecc4dc54809 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Double.cs index 4464a632db8cf1..39b10d8bc8bfaa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int16.cs index ec890b9d3e70a9..2795a44f774552 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int32.cs index 6114397381684b..71c3ff16006526 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int64.cs index 5a3ab210a069eb..ea80f44bb3f1b1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.SByte.cs index 7400dc30581b0c..26af31b4ae7c37 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Single.cs index 5bcd21c7e1a54b..38361e3440222b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt16.cs index 5bf418c4ac60ec..b9f09a9dab67f8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt32.cs index 6137cb0d557d20..12504bf9d5aedc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt64.cs index 7eef4edff8ecbf..2966fba56a74c8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Byte.cs index 5a6db9db32957b..b05ddfe8e01bfb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Double.cs index 69d7435a9e3568..3126530e3cdefd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int16.cs index e8a0fd4b0368d1..2d89c353098106 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int32.cs index 7f8c219bcaddf6..a1af6ee115514f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int64.cs index 9e5fc00053df36..5564a36e82062f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.SByte.cs index 0393dab2767cf5..07dfbe2ebf0987 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Single.cs index eca111ef182b0e..7204b4710c983c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt16.cs index 8543b27d22970d..4c821eefbb1843 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt32.cs index 2b50d7d7ff4f06..7d0f8f5bb616d7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt64.cs index 3de2575d206b7b..6a32410d2e87c7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/LessThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Byte.cs index c6340d6d66cbdf..8ee96a2dd861e9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Double.cs index df2b280ce39aeb..59f7b849e7a039 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int16.cs index 970a3c59d43fdb..574262fdfdd051 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int32.cs index 1fc8d4137807ea..54eb8857cedc4a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int64.cs index 20a5775b1bbb6d..ba642aa598f24b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.SByte.cs index 4a6ef4e75d49a8..cfd19f82a2038c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Single.cs index b1f73413fa32cb..4463f90f4db6b2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt16.cs index 6f8914cf42940c..7a1726fcb3da19 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt32.cs index 57d8265f376eb1..b3825db65a40e3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt64.cs index 7b829660428f16..a01e4459d8cc98 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Max.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Byte.cs index 544ee64951f433..d58bedc0f52dad 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Double.cs index fbc8cc96972221..620bf9d20eb62b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int16.cs index 1ec606c2509288..2e29b253d3d464 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int32.cs index 9fa08c467c7f28..c067a9849aa5be 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int64.cs index 08f9a2d7e37a66..42e385921ac000 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.SByte.cs index b895add0891694..7bf70a39169b88 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Single.cs index 2c296ec29aa614..b1a9c43e00219d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt16.cs index b36404a3d085fe..1716b500badafb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt32.cs index 9f72471613e7e5..04a537038da63b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt64.cs index 50253239afe5f5..6415668be236b7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Min.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Byte.cs index e1855e18afc579..de50ebc52b2d76 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Double.cs index b2e3c3f5d6a530..97280181de1c45 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int16.cs index 271db53696a235..7dc68b2263d906 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int32.cs index 24edbb526b4821..0686b224c16007 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int64.cs index e1ad8fb903db61..dc4f1db8a3c449 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.SByte.cs index 9ed5b5b19d822b..2bba563a304169 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Single.cs index 27b826719d063c..48782e1c09c659 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt16.cs index b3a1a59ef3ce72..0900b82e98a25e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt32.cs index b8c598f3edd0db..b30863c2e54728 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt64.cs index cf9f44e64ab61e..c521ef9bed2020 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Double.cs index 994450ff6232e3..9c9317a4eb03bf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int16.cs index 1d0f7c8a05cbb1..97b4b6a8d4a8cf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int32.cs index a0cff146f952c2..23e12fd905fa10 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int64.cs index 67b5ee0bae1ea3..f2621c9613d73c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt16.cs index 4e33e467df85b7..09e725dbb60ae6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, Byte[] outArray, int alig int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt32.cs index 1d3d959b37b1eb..361cbeb3ab6427 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt64.cs index d985f269820fd3..4a4b571ace6d24 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Narrow.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Byte.cs index b0107f0a452079..a49af30b29910b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Double.cs index b8bd348101d249..43a4f98fb6d331 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int16.cs index ab32c910915e63..27713213eaab67 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int32.cs index def8173a3b158e..b6955c26cbda91 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int64.cs index 0e8eccd48ca718..b7bc4c9eeae624 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.SByte.cs index 420c994f6678d9..b57893ddcc2050 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Single.cs index d11b5fc0a3b70d..1c71e033b5fadb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt16.cs index e5cb580ddb04b5..06a741d8dc4f3a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt32.cs index e130e771d2917d..9e5813a81132f5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt64.cs index 2c80af9e52f3be..836175b5347860 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Negate.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Byte.cs index aa99309423564d..ec3d38b00d8c21 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Double.cs index 87bdf9df4d7ca6..62dfaf71f7e356 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int16.cs index 734f1ed4811ddf..b07ee96d67d229 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int32.cs index 5e1850b2d607c1..a21be99b20bfac 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int64.cs index 8f8576ae0248ee..36635169f7185b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.SByte.cs index b0130d00d62414..129110b96cc480 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Single.cs index 01b47a1b25956b..db087c512df20b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt16.cs index 5f2d0f64138d2a..9e572867adbbc6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt32.cs index 5fa2ecebe44528..bb2c3262d90806 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt64.cs index 99263bd3c0a6ae..534105e4c3fe8d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Byte.cs index 915f334636761e..98a820fdbd8227 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Double.cs index ebd288c1783c0d..c574bed73ee359 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int16.cs index e154f76606d036..9b6117651eae53 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int32.cs index 4ca12873847d7c..3b833009c5aabd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int64.cs index dac7283be3248b..a5775166daab48 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.SByte.cs index d2314ed8e3680e..8a9759bb91db2b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Single.cs index 0169e28545a281..f20fd4a6114eea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt16.cs index 6b53bd0dfed484..5fd73c39b7af93 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt32.cs index 58773449c37853..15e1a701a35e13 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt64.cs index c421df68c95eac..edda3149fa5fe3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Sqrt.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Byte.cs index 9d2fd063d14064..66a5977a4d2965 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Double.cs index ebbb3894db483b..60a54c06567b68 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int16.cs index 798e96550f9a82..f99320806e0df9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int32.cs index 9ba837e6a2cd96..047026a5b19fd8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int64.cs index ce837363d5a7b4..488cf3499b9f90 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.SByte.cs index 85384f6a632d63..7c98b58946e8f4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Single.cs index 990f23423f57c9..6b211057ce5b41 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt16.cs index 02c2565db4b6c5..f27c43c0de8e7b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt32.cs index 23e3b75994893b..4fdc246de1cecc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt64.cs index 5c2882301655d2..7c4d98835eb5c5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Subtract.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Double.cs index fbb673a84c339e..b73c2416f40763 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Double.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Double[] outLowerArray, Double[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int16.cs index 63af03cab5c144..6f4188dfba846d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int16.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, Int16[] outLowerArray, Int16[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int32.cs index c0cc88bd180eb3..b3aa3e9e9d7bb7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int32[] outLowerArray, Int32[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int64.cs index 5106b7c5fa36c7..b69cf008549897 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int64[] outLowerArray, Int64[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt16.cs index 6a6369bc814d17..c72b6660af61a5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, UInt16[] outLowerArray, UInt16[] outUpperArray int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt32.cs index 388714ca726c1f..29d0f3f5413723 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt32[] outLowerArray, UInt32[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt64.cs index bdabc309aa86f4..adbdae01c4b4a1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Widen.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt64[] outLowerArray, UInt64[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Byte.cs index 7e73775885ef35..1731e8c42fdcce 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Double.cs index 282a0a25aefc16..1098c9b787b6ea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int16.cs index c6bcc9981ef7db..fcd456d2b0051c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int32.cs index c717be199d5ef5..b91feb4e6318d1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int64.cs index 743486675d0523..de42025cbf2184 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.SByte.cs index 149f671b6b42ca..b590ca18ddfbe3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Single.cs index 6a69bc9a7374cd..477b6f04c3f0bd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt16.cs index 17eb4ed86094a2..f26a8c40f18d43 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt32.cs index 6f7d8996c785df..d47030d3cdefbc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt64.cs index cd000b673fdf8d..24d3348f78fc30 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Xor.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Byte.cs index 26dac9f324a19e..6f1d51cc87b669 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Double.cs index 0a611b6af7cfec..156e75df1102d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int16.cs index 97767efcbe2d3d..0f72a241c4fdcb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int32.cs index 543ca77f0d41bc..8fac54f19139ae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int64.cs index 657e5bef13cc3e..cf78b57ad69a54 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.SByte.cs index b67c72e1585764..f88ea4b6f19b2b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Single.cs index 19ef57cce0b630..26aba310f659bf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt16.cs index 2b35614490b4c1..f4fd3715bcdbe2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt32.cs index b8cf5449e9232a..5e54589922c811 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt64.cs index 738c079d86f449..ee9b4f941587b7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Addition.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Byte.cs index 0a916463d4165c..f6160cd17c67fd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Double.cs index 490541b2a6575f..302737e3e5ad87 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int16.cs index 6cefc48777efaa..ad78f428669d77 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int32.cs index 334b71c55611b0..c8dc6ab2b6eec4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int64.cs index bdee64b809dd2c..b343818b326172 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.SByte.cs index 2320d6aca30167..3633a4c59575fa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Single.cs index 6d35d40ae8a4eb..fe2d053e1f3308 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt16.cs index 88039fd120e574..c05e59d287f78f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt32.cs index c912bde7cb62af..2dc25d7c4f7ee1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt64.cs index f987bba16acf4e..aa57d0b6048cbc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Byte.cs index 316a3e4b9190f8..7d8d1e2a310a87 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Double.cs index b79b5aa8e3f1ef..f43fe39f2cc648 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int16.cs index c4fbdcc547d697..fc0ee7e5a5cbed 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int32.cs index 5d4dcde0f0a3fb..d768ed7edd2f63 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int64.cs index 903f3988442417..f11b267c0a72a1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.SByte.cs index e3385e999219c4..8650d8710d4dc4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Single.cs index 508a178c49eefb..af4cd59100084b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt16.cs index f8f968f03af7e4..f43582e8c65fe7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt32.cs index 96c5f7ccf5043f..f2312393922a91 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt64.cs index 4bb9669808dad9..18b97e507aef0f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Byte.cs index 9d10ce33610290..c2836c7913d325 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Double.cs index d73140adeccc7e..ac04250e12b6a2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int16.cs index a2a660a383580d..89b0d475da9df3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int32.cs index ded06e865b37b5..2941b2a4ff100d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int64.cs index b3e86e3724b4f9..a7b750884ba946 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.SByte.cs index 185c6fee93851d..5594f6cd3ba4e9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Single.cs index c0f6b4acd949ee..cdc298f8e9bce8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt16.cs index f159a7cfaf8d5f..f584e952402e66 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt32.cs index e4e842c471b6ba..bf4872160f75dd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt64.cs index 91f8257729e864..9f31487c4b4be8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Division.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Byte.cs index 792c20abe0247e..f27301f789c497 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Double.cs index 312c732a607694..11cd5409609ec4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int16.cs index 9916c680e437d2..b2c74cc1c949db 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int32.cs index ffab571861ab23..9768159812d5f2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int64.cs index 34becd038d10c2..fafa860d666226 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.SByte.cs index dcf33227f45dc0..2e053f148bd66e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Single.cs index b854ceaafdfb6b..57516a2ff8fef6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt16.cs index 9392315e6f379c..0639b1806ac9c9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt32.cs index 5d218eb8bfc538..8721222c9a9482 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt64.cs index 6c4230ebd5c363..0bc2a4d7f17acb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Equality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Byte.cs index 80fc0db6279ce9..44ac89e247e90c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Double.cs index 8d17016980388d..edcee8158f565c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int16.cs index bdb7815cd21488..a06bd0bc8395c7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int32.cs index 2c2ac072890400..f50dfc4d292b2f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int64.cs index 11a4a6a4d1a546..609ce256162188 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.SByte.cs index 1903863fcfa79b..16f309f7b8ba45 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Single.cs index 57048fbcf2cbb3..9366e0db45ea75 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt16.cs index 0fc90ab81a7fc5..d376f011f1d9aa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt32.cs index 3a2516e6679eb3..96860a5e57f83c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt64.cs index 0c2c11639e6a61..60d4c43d10d502 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_ExclusiveOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Byte.cs index 511325765169a2..d3b8eb0f10315b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Double.cs index 84400c75f52aac..540dae1fc0f039 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int16.cs index f6fbbb14d4a086..324c66b8d052d0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int32.cs index 27e56c4a89316a..e4bb961b87f4ec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int64.cs index 2eebcfc82e20f1..8aac2c5274dfaa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.SByte.cs index 07b1182adb591e..e709d27a5834c4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Single.cs index 45b8f3bd5e637a..38226d52a831f7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt16.cs index 4e2acbafb7b744..f2da61bd20076d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt32.cs index f0f2ae14c3de4e..74fd1cfafaba69 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt64.cs index 3b50a0bd6e8e9b..d3e1f03e854663 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Inequality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Byte.cs index 2eabba2d059cc5..dba75d1a87d85c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Double.cs index f458adff8f929c..e44fca7f868a3e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int16.cs index 94d4cf613e6bab..eecb217c621803 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int32.cs index 103a61fd6406df..b04510d23df049 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int64.cs index 59f02d4aa074d6..3475799799e71a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.SByte.cs index bfa0c811504e0a..da270327ab6eef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Single.cs index 9a5bc3bb42851e..629d1a814e6fe1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt16.cs index 4198c65ef65e72..ef2149ed3989c8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt32.cs index 51271c248d7f14..0ade2ffb16df58 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt64.cs index 9d26037b30b3f1..e86958ddd3a550 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Byte.cs index 8ef15d2b878ac9..c0b466d252eb09 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Double.cs index 1abc9f441755c6..1d6c2bdc1d8865 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int16.cs index a627de270332ae..d5ebe8aa84425f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int32.cs index b4ab66e5491922..a6e7b0aecb5d91 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int64.cs index 0282e5efd6a6b7..7f1d642416cf12 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.SByte.cs index e8259b61a8a043..9cb747b369d7b8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Single.cs index fb61d74f94ea7e..93deccbd03943c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt16.cs index 8eb12a93192fd7..ecd9ae9b407a61 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt32.cs index 5483cdebc3ebc4..34c78d7a0c52ea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt64.cs index 725bcdbaac4913..f09fac8f9bbb76 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Byte.cs index b558b83d93ce2c..5b6e55bc8743cd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Double.cs index 90b3d832feb869..5935d8f860e329 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int16.cs index f742625ed29b33..bdbcd6b20dac7d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int32.cs index 412a724eee46e9..9d34c55e7c6813 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int64.cs index 56525cb1cc3a9d..24fce128af8083 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.SByte.cs index 5d3d8b1ab316cf..01f90f61237762 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Single.cs index 36413c54f783f1..8361803f65377c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt16.cs index 785e1bc9494320..e47a8a8f60e7e5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt32.cs index ea9a7d92632565..5ff82e9819bb5c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt64.cs index 2758a35b6d4ee8..dcf9a45cb97761 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_Subtraction.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Byte.cs index 3d59509a659409..434b782c07b3b9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Double.cs index 34600f640e4688..7f8f4d05606cda 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int16.cs index 7e0236817f3ce2..496a332456fb26 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int32.cs index 770ebe2d603d5b..979072d5504e99 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int64.cs index 46cac9aadebc2f..c2fac841cb8fbd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.SByte.cs index ee875efd2be3b3..8e07ee51cbddcd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Single.cs index 6d8297aff97ffb..be8ee80050f310 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt16.cs index 43d68a9bed77bf..9656ed50d0eb9b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt32.cs index d68998460cdbd0..f95f10ab158e8e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt64.cs index 036646b07ab4dd..b0198b99e3be3f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryNegation.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Byte.cs index 0204ea6f65fe88..2c8929cdb44b65 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Double.cs index 5312ab03b4e1a1..55e2039c85ebc2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int16.cs index dc23684b52b17a..8436f0f8b7457b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int32.cs index 49f671956e5fb7..8417b23d926118 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int64.cs index 241d628707d326..867c9a2c8cb371 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.SByte.cs index a547de44fb1fe3..9d577a7cfcbed6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Single.cs index 8e9fe5de87c443..dc8f060cafda9f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt16.cs index 31b7d699c9b38b..611841de46fc81 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt32.cs index a23f478da1030c..e6535203013733 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt64.cs index 34b743e1751e01..4fe736399dec91 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/op_UnaryPlus.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 64) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Byte.cs index 1c0cac81ff873c..16a0dde72e0947 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Double.cs index 04fd99dfc8be3d..c913070c7a0d7e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int16.cs index e184046f0470f3..4e00cee9552c48 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int32.cs index 2c4032c0bffecc..12cc136324b600 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int64.cs index 6a98ebb2cd2536..de5be99b126e25 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.SByte.cs index e5044ef905221b..220f1012c3f765 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Single.cs index 2f66217dfa67c9..cd2929de6dc863 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt16.cs index 9932b064d6c0a5..84cca4dc37537d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt32.cs index ca656deba71f81..a7aa303252c877 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt64.cs index 1edf6ed9de4b5c..85588bbcc3087c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Byte.cs index 0f0cf264a247f1..7bae91cf604b43 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Double.cs index f7224a5154d449..52f335055cd073 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int16.cs index 2a726dd778f873..add68c0cfa80c1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int32.cs index 2f9fb24aa010bb..5e9d732b69fa29 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int64.cs index ad88942f1b8e0b..19a83b236c1255 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.SByte.cs index a19de79e9da1c9..b789e2dab66623 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Single.cs index f4ceb46684985a..82431e84724e46 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt16.cs index 4bfddf31e002d8..d08253492b84d1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt32.cs index db44547ebea9ad..8178422430c0af 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt64.cs index 25e7f46bdd920c..abe226e174ced2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Byte.cs index 1f6bbe544b0a5d..97da1fa45f2dad 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Double.cs index 573d8227fa5d9b..4ffc6364266964 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int16.cs index 1c776039743154..f290519ab21f2c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int32.cs index 1a80c34ab97888..8b646f92ce4ca8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int64.cs index 8213bc5d26cd90..3adc95d0be0f8f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.SByte.cs index b7af3e9a3afe8c..c615373f3f35a2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Single.cs index 62c407fc82049d..ce7651e442d5bc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt16.cs index b8b74da205e8db..0bf9b23b0a9c41 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt32.cs index 4a0058be8a80f1..91cef940fa1193 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt64.cs index 48d66b35dbd9a8..0071257eafd541 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Byte.cs index c1db4d9dcae3a7..bd0342b4bd1b37 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Double.cs index d15e5ba3421952..ed321f3c768374 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int16.cs index 81ffcc8928770b..6c093251283f0f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int32.cs index 2ba2eaaa337b36..37ba2cb1c49b74 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int64.cs index e1876421e6e927..2ed2d011858b64 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.SByte.cs index 0e945275d8014b..0c02beaf7657db 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Single.cs index f975ecfba108fc..1eb0a7c9aa3385 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt16.cs index af5e66c7204ec9..a71379c29e8ee7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt32.cs index d2ffe9043a3671..62a9e1eefa41aa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt64.cs index 7b8dead1a1e7eb..31d6c9e8ebd4f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Byte.cs index 3a0c9f963cfcbd..675fd7bccf235f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Double.cs index bab713fc37f644..6c6285610d2d38 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int16.cs index bd9673d7657a98..b5c83c9a914bf9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int32.cs index 967b164b4cecc9..f223580c31d0ed 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int64.cs index 12c17cbb1b9d5c..ea2d3b603962d4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.SByte.cs index a0be4de8e7b422..ed0768fab3c06f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Single.cs index fe4469395672c2..9f721186c9bf69 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt16.cs index 4f4a6189113c1f..4d51ec1f44baa0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt32.cs index 9a3c0ebeb3662e..c1dc519545e446 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt64.cs index bb593e9b7860a6..ff43c8c802c850 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Double.cs index cdbf111001fa97..c29680b1e528f9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Single.cs index 0f1b159e9b5d89..ea55339bd109d4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Byte.cs index 67273461d3b912..e2f4f0fa7fca9c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Byte.cs @@ -76,7 +76,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] inArray3, Byte[] outAr int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Double.cs index 8422d4e533c41e..d85f458f6480b7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Double.cs @@ -76,7 +76,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] inArray3, Double int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int16.cs index 9371032ae1d742..f59e842a1d012c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int16.cs @@ -76,7 +76,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int32.cs index 6afb636f2df825..ba2c8bb36afd63 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int32.cs @@ -76,7 +76,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int64.cs index 8153a1d966f982..5fb71dbaa07140 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int64.cs @@ -76,7 +76,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] inArray3, Int64[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.SByte.cs index 7a1bfa6ad7eb4d..775e561282e630 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.SByte.cs @@ -76,7 +76,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] inArray3, SByte[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Single.cs index 3d04c5d801e25c..d3b2ea6aac773b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Single.cs @@ -76,7 +76,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt16.cs index 13f7250186aa83..da447c61dd15f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt16.cs @@ -76,7 +76,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] inArray3, UInt16 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt32.cs index 185e9943205a4f..41a1208b73a7c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt32.cs @@ -76,7 +76,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] inArray3, UInt32 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt64.cs index 4cfeb2732c9423..806f792a4e94c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt64.cs @@ -76,7 +76,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] inArray3, UInt64 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.Int64.cs index d7adb1831430c1..798bd082e20861 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.UInt64.cs index adcd170d11ee32..8a0f34022ab540 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt32.Single.cs index 8aa3029768340f..1d85753bc0747f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt64.Double.cs index 9dca261314f02c..cb4f5a28be0e68 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.Int32.cs index c288659a5da88d..d05f27cf46173e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.UInt32.cs index 537526b2e6f4ce..3b7abc04f75769 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt32.Single.cs index c306030d2dd5dc..6a790e64568d5c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt64.Double.cs index 9e2072b208ad5f..418177ac5adc81 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Byte.cs index 3731c964e3ea0d..e42b25b3c418b6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Double.cs index 154f0c62549ccf..22717fd3089690 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int16.cs index 167d243687306f..5a9bcf691a84ad 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int32.cs index 1510afd4e826b6..3a29e6e304c5e1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int64.cs index e6035dd2233fa8..87eb7fe18b3d9a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.SByte.cs index f15d67a48a88d3..013e4c57e7f720 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Single.cs index 83219ce3b38155..3aea98ff2717c3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt16.cs index cf63a61f7b7778..160191be8f9b96 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt32.cs index 4f80f46a02ed2c..5ec2776098b86f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt64.cs index bfd5d060de48bb..6784bdbee3c3bc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs index 21d31bebc0fbd9..ded616bf9f2c5c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs index 3111a10fd982d5..f2ffbf02bb4699 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs index 527af4c857b292..48eb7f189fdde2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs index ea16da18278aaf..9811a236de9f36 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs index 32c93a93cd09a5..dc678c0aa7111c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs index 165dfa059e0dd9..f2aad6a809f3c7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs index 6897729d04c95d..550450092bd975 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs index 26e4a085e62e20..8fd9072155837f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs index a3d47fb634a2f2..8d01c3bedeac6f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs index 370de38b1c69d6..b73d037c4a4ccc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Byte.cs index ec2bdeea676e4a..bab7c333f5b46b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Double.cs index 9698b38d8dbb0f..ecfeace97c25f2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int16.cs index dbb9b34dc39f83..e34d56cb8b2ace 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int32.cs index 77f942b56a3f14..f674b7f359e2bb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int64.cs index 44596d77068d20..3a4acc7b935471 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.SByte.cs index ca4ba061a0ab7e..c78ee95c0a5355 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Single.cs index 730ad8e4c4306e..d9b6190f4ab215 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt16.cs index 5d3c8518fcacf1..75c1e5a59a5970 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt32.cs index bbd13ee7b561d1..430bb1148ce560 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt64.cs index 801c54b44a0832..a09f46e379cca6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Byte.cs index f8c677b6b1e80a..4c6e7064e1aec0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Double.cs index 9e76246f43c3c5..1fe1eb2852ea65 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int16.cs index e3bc6dacdfe4e8..6ecdc2eeb5a73d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int32.cs index 432471ed2e3c36..d18236815ac395 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int64.cs index 2d0caac74ab138..43d94e55e556b1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.SByte.cs index d4c54696b7f516..2d24e9a30c2784 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Single.cs index f6991c67139650..c2f0e8ad1f92c9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt16.cs index b5d19dea2c4e67..df618178c8945b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt32.cs index 77e505fa363db1..4a88d1125194c0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt64.cs index 920467b5d95d87..f9c24e84d6c358 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Byte.cs index 64ffd96302582a..96dc141c34ed55 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Double.cs index f39185105c5939..8abc92c5346c75 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int16.cs index 7c47cb18c08517..ddda05c42d61ce 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int32.cs index 8cb1293a419bb1..c7e3eabb86761c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int64.cs index 617b50ded3c645..91a2779c309753 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.SByte.cs index 56fee670fbc488..75851d3e38f76a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Single.cs index 071134d7bbc1a6..4bf4a25ba71ca5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt16.cs index 17b8f86386ad72..b3aef5868d341b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt32.cs index 24a2b6dd42ce11..33f579817d4432 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt64.cs index 8f85da0a2783bf..a1bd772869bad9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Double.cs index 571b320cc18b3c..7b25e6c43239b4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Single.cs index 482c47dc7e0a5b..bc870602e306e6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Byte.cs index 460284984d74ef..e05481be775c94 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Double.cs index 26c0e4dbb24958..0d40a72100d89a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int16.cs index 2fbaf8af10f14c..138db4b7f0c25f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int32.cs index b27dce906f3d79..832e047ef66a7b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int64.cs index 4b27e53f0fe033..487e64167e51c9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.SByte.cs index 727eb1b4f07474..f7296d3b2fcb4d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Single.cs index 98742a934e141b..ea8cf0051c89ed 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt16.cs index 7ef1d623030ba8..1751ba08e3e1ee 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt32.cs index d3f2b8a9f49bfa..444b8bed593995 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt64.cs index 3dacdec450c2c4..2f5e8364d9a49f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Byte.cs index 6b1e528a642563..ec2ae0f57b6650 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Double.cs index 056a1781989955..b70144e71db32b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int16.cs index 9a2ab28332cdb7..2a8a84fd63a7f3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int32.cs index 7d85a7eca3fd88..667e2d5e13bd40 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int64.cs index e8321343f25887..d2cde08cf4578b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.SByte.cs index 6b1c23db8adb59..369e4de03c6226 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Single.cs index 4f6b75fdb51230..3aaf08d84d9ea6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt16.cs index e0b2a9d68d034c..1704494c2e8d5f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt32.cs index 167746d6f07235..74ddc1718c373c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt64.cs index 7f7a97c0ad3998..2b29ab6ec1fd3b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Byte.cs index 9acf0ea1e83afb..18770031be4144 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Double.cs index 868311cb426697..b438e3e94bedf9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int16.cs index 95d766f4b45b6c..a963ebeabeb613 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int32.cs index 2a61214bcf80f7..7605888860248f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int64.cs index 6d4c6056de46e2..51bdc1eba3a767 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.SByte.cs index f2bd648e1feb9c..f286ae68d5b7b9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Single.cs index ebc1a2c200a449..36990058738188 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt16.cs index e3a91843b8379c..66ca3c332810cf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt32.cs index a659abce52840a..b7e115d128e80f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt64.cs index d410eced03f478..ed8fe990809142 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Byte.cs index b7436f18317417..0e840e5c96a3bf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Double.cs index 8c811b06310e2c..d316ad9b712032 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int16.cs index ba900fe7a1a847..ddb37d6f67ab30 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int32.cs index f027b1c5de56b0..31cc8cc0b4e049 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int64.cs index 4f0296a4a5b6d8..1abddb014066c8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.SByte.cs index 4c3038f6cb1278..a9ae3791545e7d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Single.cs index 7c9593488c0164..fad20b244c076f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt16.cs index 751c8e06074ccd..822eab77e4f96c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt32.cs index b25b5d2827d89b..307be46cb510bd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt64.cs index 56a4538a4cfcf1..0d1df9f3e80e36 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Byte.cs index 82ba9cf1e14d26..ea0361fe4c7d5d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Double.cs index c2f21bb686ca70..d83119084b6305 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int16.cs index cfc7e7d0096bb6..5540069fe176f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int32.cs index 96cf549e6664f1..677beadc26f450 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int64.cs index 7aedf44cfd0239..148e302c1c7dc8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.SByte.cs index cf15c8f7dcb4f8..aeddc3962544f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Single.cs index c6137ac81c5887..d3847f4405f235 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt16.cs index 43cb6306148206..94183448392a71 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt32.cs index 6be1492353bd2e..c3fd43eb104b19 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt64.cs index 23752c2903817d..927adaa44edafb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Byte.cs index 2d2cc42465ad01..2b68979455be19 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Double.cs index eba13f7aa5971f..572bf19b5d503f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int16.cs index 4cac4c4db500c8..933e281bcaa917 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int32.cs index 046304204074a5..0c62fabd32ed6c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int64.cs index 00c35e89d7225e..7d946d5db62459 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.SByte.cs index 27475b73ed761e..ce030f08c96f59 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Single.cs index 5ad4482d2dfffe..703ce08dabaa92 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt16.cs index b75985f4640b2f..701c1b42e6d830 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt32.cs index 2eeef06c3ffaa1..e5d1db6442eb3d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt64.cs index fbb90b5adfda71..a4052dc1e1d112 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Byte.cs index c533096db4af69..4582435fc92160 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Double.cs index 0cb23fd7e72f55..d9082bfb4e63d5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int16.cs index 9deb07086cd99e..49510a954d6be6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int32.cs index 41601d973d1eb0..23520406fcc350 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int64.cs index ae9539fa7e0db6..231254c49c6bbf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.SByte.cs index 4b69d8decacc52..3bb710f69f09e5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Single.cs index f99372a3a14fec..bdb3bcd35301a0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt16.cs index 2a08e21d4465ad..717623a880239b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt32.cs index be1d2cab31916a..d632847a9766a3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt64.cs index 1c8c01c1ed312d..04494fff82e10d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Byte.cs index 051569dad64cda..47528badd0fd02 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Double.cs index 648a508e8c0b03..e4ae949fde7ff1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int16.cs index 903dd734c00768..e38b28ad42ee06 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int32.cs index 5aff6bede7dc39..1d9f795f25b4bb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int64.cs index 887396d4b0ae6e..90ace5e7682aeb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.SByte.cs index 33ebc47b4725ef..7595d38c7c63bd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Single.cs index 0c19674b0e5001..7dd6ef4368a104 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt16.cs index ea61b6198a534a..ccd9fad0569610 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt32.cs index 4df58c995741d9..e512e114242ce0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt64.cs index 95fbabb688854c..934f13f2d7f25b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Byte.cs index 648453d24e9819..4e088d6c3c2ffc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Double.cs index 4c880dfb494aa0..2d3b08f6f2bbeb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int16.cs index 7c428b72fd68ab..2491082bedcf99 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int32.cs index e186a627bc9c32..9cfeb26e968766 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int64.cs index 3e3d119c3741da..61b6a3347058d7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.SByte.cs index 10fdf8c2fa487d..977ff29c06e42b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Single.cs index a511c104e904bb..a81ba07abce123 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt16.cs index 2212f8ddef1b90..c46a5ee0bc2f17 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt32.cs index caf3f9de806e66..32f2fbb9650121 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt64.cs index 59019288867337..e85f8f7692075d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Byte.cs index d0db3605a24674..9b1d0b46de1646 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Double.cs index 4a6b0ed0a79c4e..8bdcd42cfc57ae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int16.cs index 640b8169a8b302..6f762f161ded43 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int32.cs index e85172b2df78e1..9003fb4094f592 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int64.cs index e6a5d095de634e..032356b592d2dc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.SByte.cs index 8b92416835c20d..0d4a706fb47dc6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Single.cs index 21a9734165ecbd..5a8f084b33f88c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt16.cs index 4fe7f45c26fb08..ba19b7fed09235 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt32.cs index db5d18df326414..70515a4c1ea16d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt64.cs index 77b98f6b133b44..16a83a3cd1df95 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Byte.cs index 3d7bdaa553012e..bc027e49445752 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Double.cs index e4d2483555d3d7..035bdbe2563d03 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int16.cs index 10fea63d9c07ee..0aca4cbedbefaa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int32.cs index 0ccc9f8287bec0..642313d7c27b8e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int64.cs index e306c09d8103da..c7877d7de95d95 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.SByte.cs index f5adf587d61da0..bb3718419baaec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Single.cs index 5d8d858db3764e..4e0b4ae85dd238 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt16.cs index 35823273d1701d..65d954ac32009c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt32.cs index fd20eea068e8e2..bc4078beb05a68 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt64.cs index bf9bdaedba02b6..f5e179fa3cc2c0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Byte.cs index 4e2357cc6b7651..0a676cac0f315d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Double.cs index 3ec6c095d9f14e..03860441783cd6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int16.cs index d4f756c2978091..2dc0611165f150 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int32.cs index c8aef93d50ccd1..0e4b35262a7b0a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int64.cs index a18bfe4a225a60..9211a6b290581a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.SByte.cs index d0dc240978c7c2..18077829eed5ba 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Single.cs index 6de7bc6a6d51d1..4b5e203d6a13f8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt16.cs index d9ba96e8262c62..5c95df35afe78d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt32.cs index 410fefffd8d65d..68a2df713da285 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt64.cs index 881816aef28d41..40615a6427fe11 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Byte.cs index eb297adb545c38..66a972d2947f33 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Double.cs index 5d132fc77e6e3e..b080d35856ce3d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int16.cs index a7f285ae505e9f..d9529dd156dccc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int32.cs index 1d0633e0927b3f..7dae3afaf68088 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int64.cs index aa0b7e90667759..65d3dcd29877bb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.SByte.cs index 272cb288e67b5a..571b8db6a4b0fb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Single.cs index 232d88542a59be..068b33589eda5b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt16.cs index 6759340c10f983..259875955b007d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt32.cs index 79efe1241e6e40..4327604777b8d7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt64.cs index daff133422c16e..9b6810b0108c37 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Byte.cs index 888183fbf4243f..bc4729862c3a47 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Double.cs index dd7234e6557dda..82ccb2a3b94101 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int16.cs index e21535e71ac244..b216643c32e5df 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int32.cs index 01f2db58ccabd5..ab9bd6b290244c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int64.cs index 831d891f517d65..5428e7ac0ca7d6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.SByte.cs index 8fdf6b476403c1..3ac155555065e5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Single.cs index 534413b1b1010a..2b4da9c7dea83f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt16.cs index e59fabb1bc0c88..756fd1c8d0badd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt32.cs index 47258286a73c65..7803b1922212c6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt64.cs index 2aa0a906bfa94f..18c967c3dbf676 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Byte.cs index 6ffa52360e3956..1f339c0da86aa3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Double.cs index 67b7d2b2468994..82b01ba0604712 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int16.cs index 77da725e8ad714..7fd8ac2e24edbd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int32.cs index dca87ac2e62f46..eb97a888bfe33d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int64.cs index bb737232eb9669..7f59a166f52d03 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.SByte.cs index 37dc982d09ea61..a281d52abb5594 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Single.cs index c176d3a2db7988..57ceb8833ba9ab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt16.cs index f3119c15fa50ab..718cf1d12e1ca5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt32.cs index 403812874bac94..21b2f1710d3045 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt64.cs index c774c6ec9c70eb..12fc8204c015fa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Double.cs index a0f6c6781bc162..3ae2a23a54e090 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int16.cs index 8a1bb0fa263f3d..fc77d44472771f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int32.cs index f591f78ee1a775..722a87e1fc2d1d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int64.cs index 06089434910aa5..0e88a190edf627 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt16.cs index a7a3294b758a4c..e10f22462b424d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, Byte[] outArray, int alig int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt32.cs index 71bb2c64113101..390e7710ccebad 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt64.cs index 64d21392c84291..22766d67fa650f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Byte.cs index 930321988577ae..0e68ec3306a961 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Double.cs index ce91b6d1d54d19..c597a9887974f0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int16.cs index 687a37cb9348a2..7f09a078e0e2b5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int32.cs index c55118a4a3656c..e23aa39221025e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int64.cs index ac42ac9cbf1096..996ecb74eb6a69 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.SByte.cs index 994987db0e3867..2c6713d8df41b2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Single.cs index e6cbf58206d80b..8d767fcf3b6bab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt16.cs index 2e9476787c08f8..9c499448f769c4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt32.cs index 5c7631fc0484dd..24266de1fe2780 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt64.cs index 44953de69ecd65..cd6aef380700b5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Byte.cs index e589b55157fca3..5aaa741d825de5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Double.cs index 56271cafe3524c..71b368c152d083 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int16.cs index 7543834e84f226..da0a9881537cd3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int32.cs index 25223621b24374..a3cf7966af83a4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int64.cs index a0979097afe33c..7e31e3550b98cc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.SByte.cs index 65a9a439fe8002..98754eb723ce06 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Single.cs index 7c4f4dbac9cba1..b53b0578ecdd96 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt16.cs index b92d5907d6ffaa..4b19002e9b05e8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt32.cs index 3c7ca65a46d023..f9fa485ced6448 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt64.cs index efc64905701610..8a5f0f5baeef90 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Byte.cs index f56508ce1188cc..063fbd9a9a1ef6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Double.cs index a885e0dbd4dd78..a8700dd340a10b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int16.cs index 019672f2e2dab1..8a0899de69613c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int32.cs index f871a42ad62ac0..6cff4793e2d97f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int64.cs index 292d09db9fb81b..5aadf8cb2a80f0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.SByte.cs index c14fa03b3f2af0..fb33947ca8f470 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Single.cs index 40994f4dfecfa5..4698f8bd6e5006 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt16.cs index 4f2d048fd8b0a6..295e78a44dd95d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt32.cs index 21f539b5a83521..bfbda14776a585 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt64.cs index 57b30e3bfaa8b6..e4938386a0c0d8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Byte.cs index 763fa64258d433..528cfabdc40ea3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Double.cs index 56196801674b0c..d03a8a61df87e0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int16.cs index c5fc582cdac80a..640a69476da471 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int32.cs index 711abc8e481bb4..e407e28f80800b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int64.cs index b27ca49d6153ba..3a3439318bb829 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.SByte.cs index 8b5db019b5d5e7..31c0266ee103cb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Single.cs index 743bc151bcec39..a9b4db679d759a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt16.cs index 36e3e5956fde3a..fcf8af4884dfeb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt32.cs index 2c2b3053bb7c98..8c98b57d7986fb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt64.cs index 402cbe7ca573e1..5c42b6b9aa4e83 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Double.cs index 3fa88d6d1edf7d..de18ccd7da8d58 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Double.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Double[] outLowerArray, Double[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int16.cs index 5e299275c893f8..7e1c42548497a7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int16.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, Int16[] outLowerArray, Int16[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int32.cs index 55f20a2d5ead8a..e838f7ca0d5aab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int32[] outLowerArray, Int32[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int64.cs index 82eab00fe1caac..7882c186e55161 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int64[] outLowerArray, Int64[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt16.cs index 9d488ead547cc2..357f6eb815064e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, UInt16[] outLowerArray, UInt16[] outUpperArray int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt32.cs index 9600b82d342383..1cd42a679e4ba4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt32[] outLowerArray, UInt32[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt64.cs index e51648d18e9cf6..970e2eb4eb8419 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt64[] outLowerArray, UInt64[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Byte.cs index c556759272e6ce..dc92d532df8bfb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Double.cs index 9c9fc9dac079d7..fcdd891b797140 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int16.cs index 3044cb5c2b69c7..8ef99b58b0eca5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int32.cs index cd24c256ef38af..5cc0ad008cf596 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int64.cs index 6fb676009d6c48..3e8249f0837f02 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.SByte.cs index b5f1999e245fea..8cebcc1fd68750 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Single.cs index a83c4700a59cfa..df9efbd62abc71 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt16.cs index d782cad2fcaad5..6f78deca4daf61 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt32.cs index 7521df516a765b..d5403b33873135 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt64.cs index fb4707c0d2cade..fda3436e1a9dd7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Byte.cs index 4d795afd958e98..4df9ae9ffb52c5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Double.cs index 37bee6120d470d..84029b9c4685a3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int16.cs index 4bed580e4b6452..b35dd4378d5eaa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int32.cs index 45528d075a5f7a..11cd59c4ffbacf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int64.cs index 9a84ece57a1459..50ae3c19dbd73f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.SByte.cs index 0166c84fe3520c..52b32ed51bbb38 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Single.cs index 3a5795d0736232..cd32b07b14036f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt16.cs index 8cbbbebbd6858d..4bd59043f310aa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt32.cs index ba1a2e37461eb0..d656a27c8891f7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt64.cs index 0c09b8d6605e0c..3b7ca5b403dab2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Byte.cs index c15a9d72624d75..7a0c4eb3860e4d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Double.cs index ff61dba4df037c..ddab56cd3528c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int16.cs index e5402af9f72a53..334931fb6c1dc7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int32.cs index 3e9e9f7876d21a..64f6f943f56289 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int64.cs index 9983160f61e327..6f7c76c42b684a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.SByte.cs index f84dc6c36feff9..ce5965b6ef8f80 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Single.cs index 880e2dd2ce00fd..710e91100940f0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt16.cs index 99a00024599b86..de6d6e7f4716df 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt32.cs index 8dae38cc0659f4..d4fc46a27968d0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt64.cs index b5a39f72ff83e9..80bf76460a1225 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Byte.cs index 0426a538037f26..8ad2a2b2302c37 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Double.cs index a22c6312fdbe69..51e718953dd6ab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int16.cs index 41c13faafe332f..97cb96b944e796 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int32.cs index 2c95c3c54324c1..e9d9d06e96a12b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int64.cs index d72cae0aeb0b06..ce74a0dbb6a082 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.SByte.cs index 3e9b0ccbdea4d7..d9b5737797835d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Single.cs index f1d81e5c5ba38a..562d83347b7055 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt16.cs index 7fb2d13f7e559c..55f0f97890e3b6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt32.cs index 5124954d09e9fc..c2e0758ee8763d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt64.cs index c97081a8c5b35c..4e188b814c88e1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Byte.cs index ed9b88677554c5..01dce0bf4d0a7a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Double.cs index 3e29920f26218b..d4d2a71f301556 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int16.cs index ea8ab23e8a1576..0165d4694d138c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int32.cs index c71e84a26abb79..c7d57d519ed0cc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int64.cs index e713b406447da0..cd0234189a6744 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.SByte.cs index 97f0645ab3e031..c25746a252b8af 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Single.cs index ac51e74bbb69cc..723dcce509d3b4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt16.cs index c3316c3a339f80..e91f8f8fbdcd6a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt32.cs index dda86205cb0bac..3fd16b3fe5f6ef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt64.cs index ad78479ab7bba3..40a8563d5f808d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Byte.cs index 41085052f6c458..ee05a0b4731973 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Double.cs index 3dcb3920eb15f9..110434ed2f771e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int16.cs index 43a1b90ba20f75..aa7416fa883da5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int32.cs index 131e18a4881d6a..9af9779023146c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int64.cs index 7f17edb734c94d..7e550b6559cca7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.SByte.cs index 4ae9706f89fc20..7063fda2ce0a54 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Single.cs index 96dc6064cb2029..58b1e55f1ca08c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt16.cs index e34aaaca21e040..c86ecf95ae2486 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt32.cs index 8e158efced4eca..5bd33642c84f9d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt64.cs index a7adc66c5c12ed..d6354b125e9f77 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Byte.cs index c189b3c297c014..9e84f805fac784 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Double.cs index 056993d703e499..d0b058f51df876 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int16.cs index 6b8185b61fdb87..bfaf96410ac329 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int32.cs index a2ef9307194752..56ba808d11e77a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int64.cs index f0243660596b9a..08c0943681e3e0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.SByte.cs index 3f4357c86af1bd..43a7db7a82926e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Single.cs index a1f0c5624f4c09..0e477fa40b1b2f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt16.cs index 15c66755b31bb0..28993387f5ef3c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt32.cs index 63c64baa1395fe..642802d7ed1b52 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt64.cs index c6434eed0ddf4b..f9ac99a59ac426 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Byte.cs index 23bd13cd0b256d..2f34e8591be1f9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Double.cs index d9d134cf9714d6..3d97ee64f0f1ed 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int16.cs index 665091c9c212e6..84a3b6010caa75 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int32.cs index ccd18e468268bb..fc8a8a7e44d7af 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int64.cs index 5defc877605921..c3da9ebfae445c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.SByte.cs index 9d142c936dca35..c0020335ae8a41 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Single.cs index cee84a404cc6f4..43e3aac99da723 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt16.cs index 910270aed74572..dc77ae6fe0ce81 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt32.cs index 3a123b3d991f8c..d2c8bc28adda29 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt64.cs index 041d0539db15b1..a99140bec397bc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Byte.cs index 7192d0b24dc0f5..3d16fafbf7bf3e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Double.cs index 019150e52c6d88..aa739edaa465e7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int16.cs index 491fd9b9149146..4662fb556b90ae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int32.cs index 113e6e625efe00..01a539d4a197bd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int64.cs index fc4f3b57baae52..1439f8d8322d80 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.SByte.cs index 30a32fe2183df0..00b835aee50a99 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Single.cs index 7510d3488bcfe7..a4dadb19e64dec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt16.cs index a565c5196da70e..2478adc82ffca6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt32.cs index 574b5c0e201485..6679d93c548cb9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt64.cs index 08b24d4f8dcc74..32039a1928a2a0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Byte.cs index 641d881b923af6..5a506bd4476510 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Double.cs index 09c9459d3bddc6..75c08ac9da7a80 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int16.cs index e068740a6e9f92..88ab8325b81d4d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int32.cs index 5aec614e6f615d..9edeb031c189b7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int64.cs index b99ddced7a066f..18f59232c2eb96 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.SByte.cs index 7c71cee32ed16d..e5f09037b3318e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Single.cs index 93e9abf0b1ae2b..e6ff40fb22dc8b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt16.cs index b549db17ab8f8a..b44a868a1208de 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt32.cs index 2a38b2214f5438..09215846c3f968 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt64.cs index 84b175513ca4b0..48c702b61b3f25 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Byte.cs index 983ac4906627c0..5e65c125c069b2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Double.cs index e7fe21becea4c2..4f97454dee6801 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int16.cs index 625a635fa911f0..dd49f4c9586003 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int32.cs index c266ecebf21307..de477fdbf4b3ed 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int64.cs index 1be94fbc5bb386..d55318932a78fa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.SByte.cs index 534c9c0e16e57c..76d489912551ce 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Single.cs index c567b830869f18..134394691d8f23 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt16.cs index a8e06ff5db79b9..2d4efc28f4bc1f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt32.cs index 4e1ed7f6212746..688bf2a69e1e04 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt64.cs index ac3d0fd79f5979..fa081d52a4036b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Byte.cs index 897d8bb61b77a5..95c694184c1eab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Double.cs index 3d27ad7da9f17c..d95b0efbd93ca2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int16.cs index 01c14c95fb572a..6cad83b93853c6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int32.cs index dd322b0e8461a4..3cb51a5ea390a1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int64.cs index d2f9568eb371a4..3892040e3f83ce 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.SByte.cs index 6a6c7d4db1732c..8b502e3fc86559 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Single.cs index 8663ef70785115..88264a03f5ff10 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt16.cs index 103f217e740a33..0d785f50d6f067 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt32.cs index 0bf93c76c6dd3d..bfb8b35211e0b0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt64.cs index a3bb742f404d15..2784450112c653 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Byte.cs index 4b83724a263804..22d84088d9e526 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Double.cs index 66ec6cf102c5cd..65a4a1353f0fd9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int16.cs index a85b0e6c23d3ae..99d73215a787c3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int32.cs index 78191c1ea98628..952e1da994b7fb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int64.cs index eb9a71d812fdd6..7325cf4461086e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.SByte.cs index 8f959a108d267a..b044da7c0cfc2f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Single.cs index 94e47abed3d5ff..1a8f3348237acf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt16.cs index 52b7e9d2b119f1..ee6de18f1e89b8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt32.cs index c50723d2672e5d..ab3261ef542c0f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt64.cs index d9dbeb4b21f7a6..614928d1bd2630 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if ((alignment != 64 && alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } From 6d50c9a391a641178b2e85b2352d6afdd68c560e Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Wed, 16 Nov 2022 08:41:18 -0800 Subject: [PATCH 14/26] Don't churn the Vector64/128/256 tests on the Vector512 PR --- .../General/Vector128/Abs.Byte.cs | 2 +- .../General/Vector128/Abs.Double.cs | 2 +- .../General/Vector128/Abs.Int16.cs | 2 +- .../General/Vector128/Abs.Int32.cs | 2 +- .../General/Vector128/Abs.Int64.cs | 2 +- .../General/Vector128/Abs.SByte.cs | 2 +- .../General/Vector128/Abs.Single.cs | 2 +- .../General/Vector128/Abs.UInt16.cs | 2 +- .../General/Vector128/Abs.UInt32.cs | 2 +- .../General/Vector128/Abs.UInt64.cs | 2 +- .../General/Vector128/Add.Byte.cs | 2 +- .../General/Vector128/Add.Double.cs | 2 +- .../General/Vector128/Add.Int16.cs | 2 +- .../General/Vector128/Add.Int32.cs | 2 +- .../General/Vector128/Add.Int64.cs | 2 +- .../General/Vector128/Add.SByte.cs | 2 +- .../General/Vector128/Add.Single.cs | 2 +- .../General/Vector128/Add.UInt16.cs | 2 +- .../General/Vector128/Add.UInt32.cs | 2 +- .../General/Vector128/Add.UInt64.cs | 2 +- .../General/Vector128/AndNot.Byte.cs | 2 +- .../General/Vector128/AndNot.Double.cs | 2 +- .../General/Vector128/AndNot.Int16.cs | 2 +- .../General/Vector128/AndNot.Int32.cs | 2 +- .../General/Vector128/AndNot.Int64.cs | 2 +- .../General/Vector128/AndNot.SByte.cs | 2 +- .../General/Vector128/AndNot.Single.cs | 2 +- .../General/Vector128/AndNot.UInt16.cs | 2 +- .../General/Vector128/AndNot.UInt32.cs | 2 +- .../General/Vector128/AndNot.UInt64.cs | 2 +- .../General/Vector128/BitwiseAnd.Byte.cs | 2 +- .../General/Vector128/BitwiseAnd.Double.cs | 2 +- .../General/Vector128/BitwiseAnd.Int16.cs | 2 +- .../General/Vector128/BitwiseAnd.Int32.cs | 2 +- .../General/Vector128/BitwiseAnd.Int64.cs | 2 +- .../General/Vector128/BitwiseAnd.SByte.cs | 2 +- .../General/Vector128/BitwiseAnd.Single.cs | 2 +- .../General/Vector128/BitwiseAnd.UInt16.cs | 2 +- .../General/Vector128/BitwiseAnd.UInt32.cs | 2 +- .../General/Vector128/BitwiseAnd.UInt64.cs | 2 +- .../General/Vector128/BitwiseOr.Byte.cs | 2 +- .../General/Vector128/BitwiseOr.Double.cs | 2 +- .../General/Vector128/BitwiseOr.Int16.cs | 2 +- .../General/Vector128/BitwiseOr.Int32.cs | 2 +- .../General/Vector128/BitwiseOr.Int64.cs | 2 +- .../General/Vector128/BitwiseOr.SByte.cs | 2 +- .../General/Vector128/BitwiseOr.Single.cs | 2 +- .../General/Vector128/BitwiseOr.UInt16.cs | 2 +- .../General/Vector128/BitwiseOr.UInt32.cs | 2 +- .../General/Vector128/BitwiseOr.UInt64.cs | 2 +- .../General/Vector128/Ceiling.Double.cs | 2 +- .../General/Vector128/Ceiling.Single.cs | 2 +- .../Vector128/ConditionalSelect.Byte.cs | 2 +- .../Vector128/ConditionalSelect.Double.cs | 2 +- .../Vector128/ConditionalSelect.Int16.cs | 2 +- .../Vector128/ConditionalSelect.Int32.cs | 2 +- .../Vector128/ConditionalSelect.Int64.cs | 2 +- .../Vector128/ConditionalSelect.SByte.cs | 2 +- .../Vector128/ConditionalSelect.Single.cs | 2 +- .../Vector128/ConditionalSelect.UInt16.cs | 2 +- .../Vector128/ConditionalSelect.UInt32.cs | 2 +- .../Vector128/ConditionalSelect.UInt64.cs | 2 +- .../Vector128/ConvertToDouble.Int64.cs | 2 +- .../Vector128/ConvertToDouble.UInt64.cs | 2 +- .../Vector128/ConvertToInt32.Single.cs | 2 +- .../Vector128/ConvertToInt64.Double.cs | 2 +- .../Vector128/ConvertToSingle.Int32.cs | 2 +- .../Vector128/ConvertToSingle.UInt32.cs | 2 +- .../Vector128/ConvertToUInt32.Single.cs | 2 +- .../Vector128/ConvertToUInt64.Double.cs | 2 +- .../General/Vector128/Divide.Byte.cs | 2 +- .../General/Vector128/Divide.Double.cs | 2 +- .../General/Vector128/Divide.Int16.cs | 2 +- .../General/Vector128/Divide.Int32.cs | 2 +- .../General/Vector128/Divide.Int64.cs | 2 +- .../General/Vector128/Divide.SByte.cs | 2 +- .../General/Vector128/Divide.Single.cs | 2 +- .../General/Vector128/Divide.UInt16.cs | 2 +- .../General/Vector128/Divide.UInt32.cs | 2 +- .../General/Vector128/Divide.UInt64.cs | 2 +- .../General/Vector128/Dot.Byte.cs | 42 +++++++----------- .../General/Vector128/Dot.Double.cs | 42 +++++++----------- .../General/Vector128/Dot.Int16.cs | 42 +++++++----------- .../General/Vector128/Dot.Int32.cs | 42 +++++++----------- .../General/Vector128/Dot.Int64.cs | 42 +++++++----------- .../General/Vector128/Dot.SByte.cs | 42 +++++++----------- .../General/Vector128/Dot.Single.cs | 43 +++++++------------ .../General/Vector128/Dot.UInt16.cs | 42 +++++++----------- .../General/Vector128/Dot.UInt32.cs | 42 +++++++----------- .../General/Vector128/Dot.UInt64.cs | 42 +++++++----------- .../General/Vector128/Equals.Byte.cs | 2 +- .../General/Vector128/Equals.Double.cs | 2 +- .../General/Vector128/Equals.Int16.cs | 2 +- .../General/Vector128/Equals.Int32.cs | 2 +- .../General/Vector128/Equals.Int64.cs | 2 +- .../General/Vector128/Equals.SByte.cs | 2 +- .../General/Vector128/Equals.Single.cs | 2 +- .../General/Vector128/Equals.UInt16.cs | 2 +- .../General/Vector128/Equals.UInt32.cs | 2 +- .../General/Vector128/Equals.UInt64.cs | 2 +- .../General/Vector128/EqualsAll.Byte.cs | 2 +- .../General/Vector128/EqualsAll.Double.cs | 2 +- .../General/Vector128/EqualsAll.Int16.cs | 2 +- .../General/Vector128/EqualsAll.Int32.cs | 2 +- .../General/Vector128/EqualsAll.Int64.cs | 2 +- .../General/Vector128/EqualsAll.SByte.cs | 2 +- .../General/Vector128/EqualsAll.Single.cs | 2 +- .../General/Vector128/EqualsAll.UInt16.cs | 2 +- .../General/Vector128/EqualsAll.UInt32.cs | 2 +- .../General/Vector128/EqualsAll.UInt64.cs | 2 +- .../General/Vector128/EqualsAny.Byte.cs | 2 +- .../General/Vector128/EqualsAny.Double.cs | 2 +- .../General/Vector128/EqualsAny.Int16.cs | 2 +- .../General/Vector128/EqualsAny.Int32.cs | 2 +- .../General/Vector128/EqualsAny.Int64.cs | 2 +- .../General/Vector128/EqualsAny.SByte.cs | 2 +- .../General/Vector128/EqualsAny.Single.cs | 2 +- .../General/Vector128/EqualsAny.UInt16.cs | 2 +- .../General/Vector128/EqualsAny.UInt32.cs | 2 +- .../General/Vector128/EqualsAny.UInt64.cs | 2 +- .../General/Vector128/Floor.Double.cs | 2 +- .../General/Vector128/Floor.Single.cs | 2 +- .../General/Vector128/GreaterThan.Byte.cs | 2 +- .../General/Vector128/GreaterThan.Double.cs | 2 +- .../General/Vector128/GreaterThan.Int16.cs | 2 +- .../General/Vector128/GreaterThan.Int32.cs | 2 +- .../General/Vector128/GreaterThan.Int64.cs | 2 +- .../General/Vector128/GreaterThan.SByte.cs | 2 +- .../General/Vector128/GreaterThan.Single.cs | 2 +- .../General/Vector128/GreaterThan.UInt16.cs | 2 +- .../General/Vector128/GreaterThan.UInt32.cs | 2 +- .../General/Vector128/GreaterThan.UInt64.cs | 2 +- .../General/Vector128/GreaterThanAll.Byte.cs | 2 +- .../Vector128/GreaterThanAll.Double.cs | 2 +- .../General/Vector128/GreaterThanAll.Int16.cs | 2 +- .../General/Vector128/GreaterThanAll.Int32.cs | 2 +- .../General/Vector128/GreaterThanAll.Int64.cs | 2 +- .../General/Vector128/GreaterThanAll.SByte.cs | 2 +- .../Vector128/GreaterThanAll.Single.cs | 2 +- .../Vector128/GreaterThanAll.UInt16.cs | 2 +- .../Vector128/GreaterThanAll.UInt32.cs | 2 +- .../Vector128/GreaterThanAll.UInt64.cs | 2 +- .../General/Vector128/GreaterThanAny.Byte.cs | 2 +- .../Vector128/GreaterThanAny.Double.cs | 2 +- .../General/Vector128/GreaterThanAny.Int16.cs | 2 +- .../General/Vector128/GreaterThanAny.Int32.cs | 2 +- .../General/Vector128/GreaterThanAny.Int64.cs | 2 +- .../General/Vector128/GreaterThanAny.SByte.cs | 2 +- .../Vector128/GreaterThanAny.Single.cs | 2 +- .../Vector128/GreaterThanAny.UInt16.cs | 2 +- .../Vector128/GreaterThanAny.UInt32.cs | 2 +- .../Vector128/GreaterThanAny.UInt64.cs | 2 +- .../Vector128/GreaterThanOrEqual.Byte.cs | 2 +- .../Vector128/GreaterThanOrEqual.Double.cs | 2 +- .../Vector128/GreaterThanOrEqual.Int16.cs | 2 +- .../Vector128/GreaterThanOrEqual.Int32.cs | 2 +- .../Vector128/GreaterThanOrEqual.Int64.cs | 2 +- .../Vector128/GreaterThanOrEqual.SByte.cs | 2 +- .../Vector128/GreaterThanOrEqual.Single.cs | 2 +- .../Vector128/GreaterThanOrEqual.UInt16.cs | 2 +- .../Vector128/GreaterThanOrEqual.UInt32.cs | 2 +- .../Vector128/GreaterThanOrEqual.UInt64.cs | 2 +- .../Vector128/GreaterThanOrEqualAll.Byte.cs | 2 +- .../Vector128/GreaterThanOrEqualAll.Double.cs | 2 +- .../Vector128/GreaterThanOrEqualAll.Int16.cs | 2 +- .../Vector128/GreaterThanOrEqualAll.Int32.cs | 2 +- .../Vector128/GreaterThanOrEqualAll.Int64.cs | 2 +- .../Vector128/GreaterThanOrEqualAll.SByte.cs | 2 +- .../Vector128/GreaterThanOrEqualAll.Single.cs | 2 +- .../Vector128/GreaterThanOrEqualAll.UInt16.cs | 2 +- .../Vector128/GreaterThanOrEqualAll.UInt32.cs | 2 +- .../Vector128/GreaterThanOrEqualAll.UInt64.cs | 2 +- .../Vector128/GreaterThanOrEqualAny.Byte.cs | 2 +- .../Vector128/GreaterThanOrEqualAny.Double.cs | 2 +- .../Vector128/GreaterThanOrEqualAny.Int16.cs | 2 +- .../Vector128/GreaterThanOrEqualAny.Int32.cs | 2 +- .../Vector128/GreaterThanOrEqualAny.Int64.cs | 2 +- .../Vector128/GreaterThanOrEqualAny.SByte.cs | 2 +- .../Vector128/GreaterThanOrEqualAny.Single.cs | 2 +- .../Vector128/GreaterThanOrEqualAny.UInt16.cs | 2 +- .../Vector128/GreaterThanOrEqualAny.UInt32.cs | 2 +- .../Vector128/GreaterThanOrEqualAny.UInt64.cs | 2 +- .../General/Vector128/LessThan.Byte.cs | 2 +- .../General/Vector128/LessThan.Double.cs | 2 +- .../General/Vector128/LessThan.Int16.cs | 2 +- .../General/Vector128/LessThan.Int32.cs | 2 +- .../General/Vector128/LessThan.Int64.cs | 2 +- .../General/Vector128/LessThan.SByte.cs | 2 +- .../General/Vector128/LessThan.Single.cs | 2 +- .../General/Vector128/LessThan.UInt16.cs | 2 +- .../General/Vector128/LessThan.UInt32.cs | 2 +- .../General/Vector128/LessThan.UInt64.cs | 2 +- .../General/Vector128/LessThanAll.Byte.cs | 2 +- .../General/Vector128/LessThanAll.Double.cs | 2 +- .../General/Vector128/LessThanAll.Int16.cs | 2 +- .../General/Vector128/LessThanAll.Int32.cs | 2 +- .../General/Vector128/LessThanAll.Int64.cs | 2 +- .../General/Vector128/LessThanAll.SByte.cs | 2 +- .../General/Vector128/LessThanAll.Single.cs | 2 +- .../General/Vector128/LessThanAll.UInt16.cs | 2 +- .../General/Vector128/LessThanAll.UInt32.cs | 2 +- .../General/Vector128/LessThanAll.UInt64.cs | 2 +- .../General/Vector128/LessThanAny.Byte.cs | 2 +- .../General/Vector128/LessThanAny.Double.cs | 2 +- .../General/Vector128/LessThanAny.Int16.cs | 2 +- .../General/Vector128/LessThanAny.Int32.cs | 2 +- .../General/Vector128/LessThanAny.Int64.cs | 2 +- .../General/Vector128/LessThanAny.SByte.cs | 2 +- .../General/Vector128/LessThanAny.Single.cs | 2 +- .../General/Vector128/LessThanAny.UInt16.cs | 2 +- .../General/Vector128/LessThanAny.UInt32.cs | 2 +- .../General/Vector128/LessThanAny.UInt64.cs | 2 +- .../General/Vector128/LessThanOrEqual.Byte.cs | 2 +- .../Vector128/LessThanOrEqual.Double.cs | 2 +- .../Vector128/LessThanOrEqual.Int16.cs | 2 +- .../Vector128/LessThanOrEqual.Int32.cs | 2 +- .../Vector128/LessThanOrEqual.Int64.cs | 2 +- .../Vector128/LessThanOrEqual.SByte.cs | 2 +- .../Vector128/LessThanOrEqual.Single.cs | 2 +- .../Vector128/LessThanOrEqual.UInt16.cs | 2 +- .../Vector128/LessThanOrEqual.UInt32.cs | 2 +- .../Vector128/LessThanOrEqual.UInt64.cs | 2 +- .../Vector128/LessThanOrEqualAll.Byte.cs | 2 +- .../Vector128/LessThanOrEqualAll.Double.cs | 2 +- .../Vector128/LessThanOrEqualAll.Int16.cs | 2 +- .../Vector128/LessThanOrEqualAll.Int32.cs | 2 +- .../Vector128/LessThanOrEqualAll.Int64.cs | 2 +- .../Vector128/LessThanOrEqualAll.SByte.cs | 2 +- .../Vector128/LessThanOrEqualAll.Single.cs | 2 +- .../Vector128/LessThanOrEqualAll.UInt16.cs | 2 +- .../Vector128/LessThanOrEqualAll.UInt32.cs | 2 +- .../Vector128/LessThanOrEqualAll.UInt64.cs | 2 +- .../Vector128/LessThanOrEqualAny.Byte.cs | 2 +- .../Vector128/LessThanOrEqualAny.Double.cs | 2 +- .../Vector128/LessThanOrEqualAny.Int16.cs | 2 +- .../Vector128/LessThanOrEqualAny.Int32.cs | 2 +- .../Vector128/LessThanOrEqualAny.Int64.cs | 2 +- .../Vector128/LessThanOrEqualAny.SByte.cs | 2 +- .../Vector128/LessThanOrEqualAny.Single.cs | 2 +- .../Vector128/LessThanOrEqualAny.UInt16.cs | 2 +- .../Vector128/LessThanOrEqualAny.UInt32.cs | 2 +- .../Vector128/LessThanOrEqualAny.UInt64.cs | 2 +- .../General/Vector128/Max.Byte.cs | 2 +- .../General/Vector128/Max.Double.cs | 2 +- .../General/Vector128/Max.Int16.cs | 2 +- .../General/Vector128/Max.Int32.cs | 2 +- .../General/Vector128/Max.Int64.cs | 2 +- .../General/Vector128/Max.SByte.cs | 2 +- .../General/Vector128/Max.Single.cs | 2 +- .../General/Vector128/Max.UInt16.cs | 2 +- .../General/Vector128/Max.UInt32.cs | 2 +- .../General/Vector128/Max.UInt64.cs | 2 +- .../General/Vector128/Min.Byte.cs | 2 +- .../General/Vector128/Min.Double.cs | 2 +- .../General/Vector128/Min.Int16.cs | 2 +- .../General/Vector128/Min.Int32.cs | 2 +- .../General/Vector128/Min.Int64.cs | 2 +- .../General/Vector128/Min.SByte.cs | 2 +- .../General/Vector128/Min.Single.cs | 2 +- .../General/Vector128/Min.UInt16.cs | 2 +- .../General/Vector128/Min.UInt32.cs | 2 +- .../General/Vector128/Min.UInt64.cs | 2 +- .../General/Vector128/Multiply.Byte.cs | 2 +- .../General/Vector128/Multiply.Double.cs | 2 +- .../General/Vector128/Multiply.Int16.cs | 2 +- .../General/Vector128/Multiply.Int32.cs | 2 +- .../General/Vector128/Multiply.Int64.cs | 2 +- .../General/Vector128/Multiply.SByte.cs | 2 +- .../General/Vector128/Multiply.Single.cs | 2 +- .../General/Vector128/Multiply.UInt16.cs | 2 +- .../General/Vector128/Multiply.UInt32.cs | 2 +- .../General/Vector128/Multiply.UInt64.cs | 2 +- .../General/Vector128/Narrow.Double.cs | 2 +- .../General/Vector128/Narrow.Int16.cs | 2 +- .../General/Vector128/Narrow.Int32.cs | 2 +- .../General/Vector128/Narrow.Int64.cs | 2 +- .../General/Vector128/Narrow.UInt16.cs | 2 +- .../General/Vector128/Narrow.UInt32.cs | 2 +- .../General/Vector128/Narrow.UInt64.cs | 2 +- .../General/Vector128/Negate.Byte.cs | 2 +- .../General/Vector128/Negate.Double.cs | 2 +- .../General/Vector128/Negate.Int16.cs | 2 +- .../General/Vector128/Negate.Int32.cs | 2 +- .../General/Vector128/Negate.Int64.cs | 2 +- .../General/Vector128/Negate.SByte.cs | 2 +- .../General/Vector128/Negate.Single.cs | 2 +- .../General/Vector128/Negate.UInt16.cs | 2 +- .../General/Vector128/Negate.UInt32.cs | 2 +- .../General/Vector128/Negate.UInt64.cs | 2 +- .../General/Vector128/OnesComplement.Byte.cs | 2 +- .../Vector128/OnesComplement.Double.cs | 2 +- .../General/Vector128/OnesComplement.Int16.cs | 2 +- .../General/Vector128/OnesComplement.Int32.cs | 2 +- .../General/Vector128/OnesComplement.Int64.cs | 2 +- .../General/Vector128/OnesComplement.SByte.cs | 2 +- .../Vector128/OnesComplement.Single.cs | 2 +- .../Vector128/OnesComplement.UInt16.cs | 2 +- .../Vector128/OnesComplement.UInt32.cs | 2 +- .../Vector128/OnesComplement.UInt64.cs | 2 +- .../General/Vector128/Sqrt.Byte.cs | 2 +- .../General/Vector128/Sqrt.Double.cs | 2 +- .../General/Vector128/Sqrt.Int16.cs | 2 +- .../General/Vector128/Sqrt.Int32.cs | 2 +- .../General/Vector128/Sqrt.Int64.cs | 2 +- .../General/Vector128/Sqrt.SByte.cs | 2 +- .../General/Vector128/Sqrt.Single.cs | 2 +- .../General/Vector128/Sqrt.UInt16.cs | 2 +- .../General/Vector128/Sqrt.UInt32.cs | 2 +- .../General/Vector128/Sqrt.UInt64.cs | 2 +- .../General/Vector128/Subtract.Byte.cs | 2 +- .../General/Vector128/Subtract.Double.cs | 2 +- .../General/Vector128/Subtract.Int16.cs | 2 +- .../General/Vector128/Subtract.Int32.cs | 2 +- .../General/Vector128/Subtract.Int64.cs | 2 +- .../General/Vector128/Subtract.SByte.cs | 2 +- .../General/Vector128/Subtract.Single.cs | 2 +- .../General/Vector128/Subtract.UInt16.cs | 2 +- .../General/Vector128/Subtract.UInt32.cs | 2 +- .../General/Vector128/Subtract.UInt64.cs | 2 +- .../General/Vector128/Widen.Double.cs | 2 +- .../General/Vector128/Widen.Int16.cs | 2 +- .../General/Vector128/Widen.Int32.cs | 2 +- .../General/Vector128/Widen.Int64.cs | 2 +- .../General/Vector128/Widen.UInt16.cs | 2 +- .../General/Vector128/Widen.UInt32.cs | 2 +- .../General/Vector128/Widen.UInt64.cs | 2 +- .../General/Vector128/Xor.Byte.cs | 2 +- .../General/Vector128/Xor.Double.cs | 2 +- .../General/Vector128/Xor.Int16.cs | 2 +- .../General/Vector128/Xor.Int32.cs | 2 +- .../General/Vector128/Xor.Int64.cs | 2 +- .../General/Vector128/Xor.SByte.cs | 2 +- .../General/Vector128/Xor.Single.cs | 2 +- .../General/Vector128/Xor.UInt16.cs | 2 +- .../General/Vector128/Xor.UInt32.cs | 2 +- .../General/Vector128/Xor.UInt64.cs | 2 +- .../Vector128_1/Program.Vector128_1.cs | 3 ++ .../General/Vector128_1/op_Addition.Byte.cs | 2 +- .../General/Vector128_1/op_Addition.Double.cs | 2 +- .../General/Vector128_1/op_Addition.Int16.cs | 2 +- .../General/Vector128_1/op_Addition.Int32.cs | 2 +- .../General/Vector128_1/op_Addition.Int64.cs | 2 +- .../General/Vector128_1/op_Addition.SByte.cs | 2 +- .../General/Vector128_1/op_Addition.Single.cs | 2 +- .../General/Vector128_1/op_Addition.UInt16.cs | 2 +- .../General/Vector128_1/op_Addition.UInt32.cs | 2 +- .../General/Vector128_1/op_Addition.UInt64.cs | 2 +- .../General/Vector128_1/op_BitwiseAnd.Byte.cs | 2 +- .../Vector128_1/op_BitwiseAnd.Double.cs | 2 +- .../Vector128_1/op_BitwiseAnd.Int16.cs | 2 +- .../Vector128_1/op_BitwiseAnd.Int32.cs | 2 +- .../Vector128_1/op_BitwiseAnd.Int64.cs | 2 +- .../Vector128_1/op_BitwiseAnd.SByte.cs | 2 +- .../Vector128_1/op_BitwiseAnd.Single.cs | 2 +- .../Vector128_1/op_BitwiseAnd.UInt16.cs | 2 +- .../Vector128_1/op_BitwiseAnd.UInt32.cs | 2 +- .../Vector128_1/op_BitwiseAnd.UInt64.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.Byte.cs | 2 +- .../Vector128_1/op_BitwiseOr.Double.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.Int16.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.Int32.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.Int64.cs | 2 +- .../General/Vector128_1/op_BitwiseOr.SByte.cs | 2 +- .../Vector128_1/op_BitwiseOr.Single.cs | 2 +- .../Vector128_1/op_BitwiseOr.UInt16.cs | 2 +- .../Vector128_1/op_BitwiseOr.UInt32.cs | 2 +- .../Vector128_1/op_BitwiseOr.UInt64.cs | 2 +- .../General/Vector128_1/op_Division.Byte.cs | 2 +- .../General/Vector128_1/op_Division.Double.cs | 2 +- .../General/Vector128_1/op_Division.Int16.cs | 2 +- .../General/Vector128_1/op_Division.Int32.cs | 2 +- .../General/Vector128_1/op_Division.Int64.cs | 2 +- .../General/Vector128_1/op_Division.SByte.cs | 2 +- .../General/Vector128_1/op_Division.Single.cs | 2 +- .../General/Vector128_1/op_Division.UInt16.cs | 2 +- .../General/Vector128_1/op_Division.UInt32.cs | 2 +- .../General/Vector128_1/op_Division.UInt64.cs | 2 +- .../General/Vector128_1/op_Equality.Byte.cs | 2 +- .../General/Vector128_1/op_Equality.Double.cs | 2 +- .../General/Vector128_1/op_Equality.Int16.cs | 2 +- .../General/Vector128_1/op_Equality.Int32.cs | 2 +- .../General/Vector128_1/op_Equality.Int64.cs | 2 +- .../General/Vector128_1/op_Equality.SByte.cs | 2 +- .../General/Vector128_1/op_Equality.Single.cs | 2 +- .../General/Vector128_1/op_Equality.UInt16.cs | 2 +- .../General/Vector128_1/op_Equality.UInt32.cs | 2 +- .../General/Vector128_1/op_Equality.UInt64.cs | 2 +- .../Vector128_1/op_ExclusiveOr.Byte.cs | 2 +- .../Vector128_1/op_ExclusiveOr.Double.cs | 2 +- .../Vector128_1/op_ExclusiveOr.Int16.cs | 2 +- .../Vector128_1/op_ExclusiveOr.Int32.cs | 2 +- .../Vector128_1/op_ExclusiveOr.Int64.cs | 2 +- .../Vector128_1/op_ExclusiveOr.SByte.cs | 2 +- .../Vector128_1/op_ExclusiveOr.Single.cs | 2 +- .../Vector128_1/op_ExclusiveOr.UInt16.cs | 2 +- .../Vector128_1/op_ExclusiveOr.UInt32.cs | 2 +- .../Vector128_1/op_ExclusiveOr.UInt64.cs | 2 +- .../General/Vector128_1/op_Inequality.Byte.cs | 2 +- .../Vector128_1/op_Inequality.Double.cs | 2 +- .../Vector128_1/op_Inequality.Int16.cs | 2 +- .../Vector128_1/op_Inequality.Int32.cs | 2 +- .../Vector128_1/op_Inequality.Int64.cs | 2 +- .../Vector128_1/op_Inequality.SByte.cs | 2 +- .../Vector128_1/op_Inequality.Single.cs | 2 +- .../Vector128_1/op_Inequality.UInt16.cs | 2 +- .../Vector128_1/op_Inequality.UInt32.cs | 2 +- .../Vector128_1/op_Inequality.UInt64.cs | 2 +- .../General/Vector128_1/op_Multiply.Byte.cs | 2 +- .../General/Vector128_1/op_Multiply.Double.cs | 2 +- .../General/Vector128_1/op_Multiply.Int16.cs | 2 +- .../General/Vector128_1/op_Multiply.Int32.cs | 2 +- .../General/Vector128_1/op_Multiply.Int64.cs | 2 +- .../General/Vector128_1/op_Multiply.SByte.cs | 2 +- .../General/Vector128_1/op_Multiply.Single.cs | 2 +- .../General/Vector128_1/op_Multiply.UInt16.cs | 2 +- .../General/Vector128_1/op_Multiply.UInt32.cs | 2 +- .../General/Vector128_1/op_Multiply.UInt64.cs | 2 +- .../Vector128_1/op_OnesComplement.Byte.cs | 2 +- .../Vector128_1/op_OnesComplement.Double.cs | 2 +- .../Vector128_1/op_OnesComplement.Int16.cs | 2 +- .../Vector128_1/op_OnesComplement.Int32.cs | 2 +- .../Vector128_1/op_OnesComplement.Int64.cs | 2 +- .../Vector128_1/op_OnesComplement.SByte.cs | 2 +- .../Vector128_1/op_OnesComplement.Single.cs | 2 +- .../Vector128_1/op_OnesComplement.UInt16.cs | 2 +- .../Vector128_1/op_OnesComplement.UInt32.cs | 2 +- .../Vector128_1/op_OnesComplement.UInt64.cs | 2 +- .../Vector128_1/op_Subtraction.Byte.cs | 2 +- .../Vector128_1/op_Subtraction.Double.cs | 2 +- .../Vector128_1/op_Subtraction.Int16.cs | 2 +- .../Vector128_1/op_Subtraction.Int32.cs | 2 +- .../Vector128_1/op_Subtraction.Int64.cs | 2 +- .../Vector128_1/op_Subtraction.SByte.cs | 2 +- .../Vector128_1/op_Subtraction.Single.cs | 2 +- .../Vector128_1/op_Subtraction.UInt16.cs | 2 +- .../Vector128_1/op_Subtraction.UInt32.cs | 2 +- .../Vector128_1/op_Subtraction.UInt64.cs | 2 +- .../Vector128_1/op_UnaryNegation.Byte.cs | 2 +- .../Vector128_1/op_UnaryNegation.Double.cs | 2 +- .../Vector128_1/op_UnaryNegation.Int16.cs | 2 +- .../Vector128_1/op_UnaryNegation.Int32.cs | 2 +- .../Vector128_1/op_UnaryNegation.Int64.cs | 2 +- .../Vector128_1/op_UnaryNegation.SByte.cs | 2 +- .../Vector128_1/op_UnaryNegation.Single.cs | 2 +- .../Vector128_1/op_UnaryNegation.UInt16.cs | 2 +- .../Vector128_1/op_UnaryNegation.UInt32.cs | 2 +- .../Vector128_1/op_UnaryNegation.UInt64.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.Byte.cs | 2 +- .../Vector128_1/op_UnaryPlus.Double.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.Int16.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.Int32.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.Int64.cs | 2 +- .../General/Vector128_1/op_UnaryPlus.SByte.cs | 2 +- .../Vector128_1/op_UnaryPlus.Single.cs | 2 +- .../Vector128_1/op_UnaryPlus.UInt16.cs | 2 +- .../Vector128_1/op_UnaryPlus.UInt32.cs | 2 +- .../Vector128_1/op_UnaryPlus.UInt64.cs | 2 +- .../General/Vector256/Abs.Byte.cs | 2 +- .../General/Vector256/Abs.Double.cs | 2 +- .../General/Vector256/Abs.Int16.cs | 2 +- .../General/Vector256/Abs.Int32.cs | 2 +- .../General/Vector256/Abs.Int64.cs | 2 +- .../General/Vector256/Abs.SByte.cs | 2 +- .../General/Vector256/Abs.Single.cs | 2 +- .../General/Vector256/Abs.UInt16.cs | 2 +- .../General/Vector256/Abs.UInt32.cs | 2 +- .../General/Vector256/Abs.UInt64.cs | 2 +- .../General/Vector256/Add.Byte.cs | 2 +- .../General/Vector256/Add.Double.cs | 2 +- .../General/Vector256/Add.Int16.cs | 2 +- .../General/Vector256/Add.Int32.cs | 2 +- .../General/Vector256/Add.Int64.cs | 2 +- .../General/Vector256/Add.SByte.cs | 2 +- .../General/Vector256/Add.Single.cs | 2 +- .../General/Vector256/Add.UInt16.cs | 2 +- .../General/Vector256/Add.UInt32.cs | 2 +- .../General/Vector256/Add.UInt64.cs | 2 +- .../General/Vector256/AndNot.Byte.cs | 2 +- .../General/Vector256/AndNot.Double.cs | 2 +- .../General/Vector256/AndNot.Int16.cs | 2 +- .../General/Vector256/AndNot.Int32.cs | 2 +- .../General/Vector256/AndNot.Int64.cs | 2 +- .../General/Vector256/AndNot.SByte.cs | 2 +- .../General/Vector256/AndNot.Single.cs | 2 +- .../General/Vector256/AndNot.UInt16.cs | 2 +- .../General/Vector256/AndNot.UInt32.cs | 2 +- .../General/Vector256/AndNot.UInt64.cs | 2 +- .../General/Vector256/BitwiseAnd.Byte.cs | 2 +- .../General/Vector256/BitwiseAnd.Double.cs | 2 +- .../General/Vector256/BitwiseAnd.Int16.cs | 2 +- .../General/Vector256/BitwiseAnd.Int32.cs | 2 +- .../General/Vector256/BitwiseAnd.Int64.cs | 2 +- .../General/Vector256/BitwiseAnd.SByte.cs | 2 +- .../General/Vector256/BitwiseAnd.Single.cs | 2 +- .../General/Vector256/BitwiseAnd.UInt16.cs | 2 +- .../General/Vector256/BitwiseAnd.UInt32.cs | 2 +- .../General/Vector256/BitwiseAnd.UInt64.cs | 2 +- .../General/Vector256/BitwiseOr.Byte.cs | 2 +- .../General/Vector256/BitwiseOr.Double.cs | 2 +- .../General/Vector256/BitwiseOr.Int16.cs | 2 +- .../General/Vector256/BitwiseOr.Int32.cs | 2 +- .../General/Vector256/BitwiseOr.Int64.cs | 2 +- .../General/Vector256/BitwiseOr.SByte.cs | 2 +- .../General/Vector256/BitwiseOr.Single.cs | 2 +- .../General/Vector256/BitwiseOr.UInt16.cs | 2 +- .../General/Vector256/BitwiseOr.UInt32.cs | 2 +- .../General/Vector256/BitwiseOr.UInt64.cs | 2 +- .../General/Vector256/Ceiling.Double.cs | 2 +- .../General/Vector256/Ceiling.Single.cs | 2 +- .../Vector256/ConditionalSelect.Byte.cs | 2 +- .../Vector256/ConditionalSelect.Double.cs | 2 +- .../Vector256/ConditionalSelect.Int16.cs | 2 +- .../Vector256/ConditionalSelect.Int32.cs | 2 +- .../Vector256/ConditionalSelect.Int64.cs | 2 +- .../Vector256/ConditionalSelect.SByte.cs | 2 +- .../Vector256/ConditionalSelect.Single.cs | 2 +- .../Vector256/ConditionalSelect.UInt16.cs | 2 +- .../Vector256/ConditionalSelect.UInt32.cs | 2 +- .../Vector256/ConditionalSelect.UInt64.cs | 2 +- .../Vector256/ConvertToDouble.Int64.cs | 4 +- .../Vector256/ConvertToDouble.UInt64.cs | 4 +- .../Vector256/ConvertToInt32.Single.cs | 2 +- .../Vector256/ConvertToInt64.Double.cs | 2 +- .../Vector256/ConvertToSingle.Int32.cs | 2 +- .../Vector256/ConvertToSingle.UInt32.cs | 2 +- .../Vector256/ConvertToUInt32.Single.cs | 2 +- .../Vector256/ConvertToUInt64.Double.cs | 2 +- .../General/Vector256/Divide.Byte.cs | 2 +- .../General/Vector256/Divide.Double.cs | 2 +- .../General/Vector256/Divide.Int16.cs | 2 +- .../General/Vector256/Divide.Int32.cs | 2 +- .../General/Vector256/Divide.Int64.cs | 2 +- .../General/Vector256/Divide.SByte.cs | 2 +- .../General/Vector256/Divide.Single.cs | 2 +- .../General/Vector256/Divide.UInt16.cs | 2 +- .../General/Vector256/Divide.UInt32.cs | 2 +- .../General/Vector256/Divide.UInt64.cs | 2 +- .../General/Vector256/Dot.Byte.cs | 42 +++++++----------- .../General/Vector256/Dot.Double.cs | 42 +++++++----------- .../General/Vector256/Dot.Int16.cs | 42 +++++++----------- .../General/Vector256/Dot.Int32.cs | 42 +++++++----------- .../General/Vector256/Dot.Int64.cs | 42 +++++++----------- .../General/Vector256/Dot.SByte.cs | 42 +++++++----------- .../General/Vector256/Dot.Single.cs | 43 +++++++------------ .../General/Vector256/Dot.UInt16.cs | 42 +++++++----------- .../General/Vector256/Dot.UInt32.cs | 42 +++++++----------- .../General/Vector256/Dot.UInt64.cs | 42 +++++++----------- .../General/Vector256/Equals.Byte.cs | 2 +- .../General/Vector256/Equals.Double.cs | 2 +- .../General/Vector256/Equals.Int16.cs | 2 +- .../General/Vector256/Equals.Int32.cs | 2 +- .../General/Vector256/Equals.Int64.cs | 2 +- .../General/Vector256/Equals.SByte.cs | 2 +- .../General/Vector256/Equals.Single.cs | 2 +- .../General/Vector256/Equals.UInt16.cs | 2 +- .../General/Vector256/Equals.UInt32.cs | 2 +- .../General/Vector256/Equals.UInt64.cs | 2 +- .../General/Vector256/EqualsAll.Byte.cs | 2 +- .../General/Vector256/EqualsAll.Double.cs | 2 +- .../General/Vector256/EqualsAll.Int16.cs | 2 +- .../General/Vector256/EqualsAll.Int32.cs | 2 +- .../General/Vector256/EqualsAll.Int64.cs | 2 +- .../General/Vector256/EqualsAll.SByte.cs | 2 +- .../General/Vector256/EqualsAll.Single.cs | 2 +- .../General/Vector256/EqualsAll.UInt16.cs | 2 +- .../General/Vector256/EqualsAll.UInt32.cs | 2 +- .../General/Vector256/EqualsAll.UInt64.cs | 2 +- .../General/Vector256/EqualsAny.Byte.cs | 2 +- .../General/Vector256/EqualsAny.Double.cs | 2 +- .../General/Vector256/EqualsAny.Int16.cs | 2 +- .../General/Vector256/EqualsAny.Int32.cs | 2 +- .../General/Vector256/EqualsAny.Int64.cs | 2 +- .../General/Vector256/EqualsAny.SByte.cs | 2 +- .../General/Vector256/EqualsAny.Single.cs | 2 +- .../General/Vector256/EqualsAny.UInt16.cs | 2 +- .../General/Vector256/EqualsAny.UInt32.cs | 2 +- .../General/Vector256/EqualsAny.UInt64.cs | 2 +- .../General/Vector256/Floor.Double.cs | 2 +- .../General/Vector256/Floor.Single.cs | 2 +- .../General/Vector256/GreaterThan.Byte.cs | 2 +- .../General/Vector256/GreaterThan.Double.cs | 2 +- .../General/Vector256/GreaterThan.Int16.cs | 2 +- .../General/Vector256/GreaterThan.Int32.cs | 2 +- .../General/Vector256/GreaterThan.Int64.cs | 2 +- .../General/Vector256/GreaterThan.SByte.cs | 2 +- .../General/Vector256/GreaterThan.Single.cs | 2 +- .../General/Vector256/GreaterThan.UInt16.cs | 2 +- .../General/Vector256/GreaterThan.UInt32.cs | 2 +- .../General/Vector256/GreaterThan.UInt64.cs | 2 +- .../General/Vector256/GreaterThanAll.Byte.cs | 2 +- .../Vector256/GreaterThanAll.Double.cs | 2 +- .../General/Vector256/GreaterThanAll.Int16.cs | 2 +- .../General/Vector256/GreaterThanAll.Int32.cs | 2 +- .../General/Vector256/GreaterThanAll.Int64.cs | 2 +- .../General/Vector256/GreaterThanAll.SByte.cs | 2 +- .../Vector256/GreaterThanAll.Single.cs | 2 +- .../Vector256/GreaterThanAll.UInt16.cs | 2 +- .../Vector256/GreaterThanAll.UInt32.cs | 2 +- .../Vector256/GreaterThanAll.UInt64.cs | 2 +- .../General/Vector256/GreaterThanAny.Byte.cs | 2 +- .../Vector256/GreaterThanAny.Double.cs | 2 +- .../General/Vector256/GreaterThanAny.Int16.cs | 2 +- .../General/Vector256/GreaterThanAny.Int32.cs | 2 +- .../General/Vector256/GreaterThanAny.Int64.cs | 2 +- .../General/Vector256/GreaterThanAny.SByte.cs | 2 +- .../Vector256/GreaterThanAny.Single.cs | 2 +- .../Vector256/GreaterThanAny.UInt16.cs | 2 +- .../Vector256/GreaterThanAny.UInt32.cs | 2 +- .../Vector256/GreaterThanAny.UInt64.cs | 2 +- .../Vector256/GreaterThanOrEqual.Byte.cs | 2 +- .../Vector256/GreaterThanOrEqual.Double.cs | 2 +- .../Vector256/GreaterThanOrEqual.Int16.cs | 2 +- .../Vector256/GreaterThanOrEqual.Int32.cs | 2 +- .../Vector256/GreaterThanOrEqual.Int64.cs | 2 +- .../Vector256/GreaterThanOrEqual.SByte.cs | 2 +- .../Vector256/GreaterThanOrEqual.Single.cs | 2 +- .../Vector256/GreaterThanOrEqual.UInt16.cs | 2 +- .../Vector256/GreaterThanOrEqual.UInt32.cs | 2 +- .../Vector256/GreaterThanOrEqual.UInt64.cs | 2 +- .../Vector256/GreaterThanOrEqualAll.Byte.cs | 2 +- .../Vector256/GreaterThanOrEqualAll.Double.cs | 2 +- .../Vector256/GreaterThanOrEqualAll.Int16.cs | 2 +- .../Vector256/GreaterThanOrEqualAll.Int32.cs | 2 +- .../Vector256/GreaterThanOrEqualAll.Int64.cs | 2 +- .../Vector256/GreaterThanOrEqualAll.SByte.cs | 2 +- .../Vector256/GreaterThanOrEqualAll.Single.cs | 2 +- .../Vector256/GreaterThanOrEqualAll.UInt16.cs | 2 +- .../Vector256/GreaterThanOrEqualAll.UInt32.cs | 2 +- .../Vector256/GreaterThanOrEqualAll.UInt64.cs | 2 +- .../Vector256/GreaterThanOrEqualAny.Byte.cs | 2 +- .../Vector256/GreaterThanOrEqualAny.Double.cs | 2 +- .../Vector256/GreaterThanOrEqualAny.Int16.cs | 2 +- .../Vector256/GreaterThanOrEqualAny.Int32.cs | 2 +- .../Vector256/GreaterThanOrEqualAny.Int64.cs | 2 +- .../Vector256/GreaterThanOrEqualAny.SByte.cs | 2 +- .../Vector256/GreaterThanOrEqualAny.Single.cs | 2 +- .../Vector256/GreaterThanOrEqualAny.UInt16.cs | 2 +- .../Vector256/GreaterThanOrEqualAny.UInt32.cs | 2 +- .../Vector256/GreaterThanOrEqualAny.UInt64.cs | 2 +- .../General/Vector256/LessThan.Byte.cs | 2 +- .../General/Vector256/LessThan.Double.cs | 2 +- .../General/Vector256/LessThan.Int16.cs | 2 +- .../General/Vector256/LessThan.Int32.cs | 2 +- .../General/Vector256/LessThan.Int64.cs | 2 +- .../General/Vector256/LessThan.SByte.cs | 2 +- .../General/Vector256/LessThan.Single.cs | 2 +- .../General/Vector256/LessThan.UInt16.cs | 2 +- .../General/Vector256/LessThan.UInt32.cs | 2 +- .../General/Vector256/LessThan.UInt64.cs | 2 +- .../General/Vector256/LessThanAll.Byte.cs | 2 +- .../General/Vector256/LessThanAll.Double.cs | 2 +- .../General/Vector256/LessThanAll.Int16.cs | 2 +- .../General/Vector256/LessThanAll.Int32.cs | 2 +- .../General/Vector256/LessThanAll.Int64.cs | 2 +- .../General/Vector256/LessThanAll.SByte.cs | 2 +- .../General/Vector256/LessThanAll.Single.cs | 2 +- .../General/Vector256/LessThanAll.UInt16.cs | 2 +- .../General/Vector256/LessThanAll.UInt32.cs | 2 +- .../General/Vector256/LessThanAll.UInt64.cs | 2 +- .../General/Vector256/LessThanAny.Byte.cs | 2 +- .../General/Vector256/LessThanAny.Double.cs | 2 +- .../General/Vector256/LessThanAny.Int16.cs | 2 +- .../General/Vector256/LessThanAny.Int32.cs | 2 +- .../General/Vector256/LessThanAny.Int64.cs | 2 +- .../General/Vector256/LessThanAny.SByte.cs | 2 +- .../General/Vector256/LessThanAny.Single.cs | 2 +- .../General/Vector256/LessThanAny.UInt16.cs | 2 +- .../General/Vector256/LessThanAny.UInt32.cs | 2 +- .../General/Vector256/LessThanAny.UInt64.cs | 2 +- .../General/Vector256/LessThanOrEqual.Byte.cs | 2 +- .../Vector256/LessThanOrEqual.Double.cs | 2 +- .../Vector256/LessThanOrEqual.Int16.cs | 2 +- .../Vector256/LessThanOrEqual.Int32.cs | 2 +- .../Vector256/LessThanOrEqual.Int64.cs | 2 +- .../Vector256/LessThanOrEqual.SByte.cs | 2 +- .../Vector256/LessThanOrEqual.Single.cs | 2 +- .../Vector256/LessThanOrEqual.UInt16.cs | 2 +- .../Vector256/LessThanOrEqual.UInt32.cs | 2 +- .../Vector256/LessThanOrEqual.UInt64.cs | 2 +- .../Vector256/LessThanOrEqualAll.Byte.cs | 2 +- .../Vector256/LessThanOrEqualAll.Double.cs | 2 +- .../Vector256/LessThanOrEqualAll.Int16.cs | 2 +- .../Vector256/LessThanOrEqualAll.Int32.cs | 2 +- .../Vector256/LessThanOrEqualAll.Int64.cs | 2 +- .../Vector256/LessThanOrEqualAll.SByte.cs | 2 +- .../Vector256/LessThanOrEqualAll.Single.cs | 2 +- .../Vector256/LessThanOrEqualAll.UInt16.cs | 2 +- .../Vector256/LessThanOrEqualAll.UInt32.cs | 2 +- .../Vector256/LessThanOrEqualAll.UInt64.cs | 2 +- .../Vector256/LessThanOrEqualAny.Byte.cs | 2 +- .../Vector256/LessThanOrEqualAny.Double.cs | 2 +- .../Vector256/LessThanOrEqualAny.Int16.cs | 2 +- .../Vector256/LessThanOrEqualAny.Int32.cs | 2 +- .../Vector256/LessThanOrEqualAny.Int64.cs | 2 +- .../Vector256/LessThanOrEqualAny.SByte.cs | 2 +- .../Vector256/LessThanOrEqualAny.Single.cs | 2 +- .../Vector256/LessThanOrEqualAny.UInt16.cs | 2 +- .../Vector256/LessThanOrEqualAny.UInt32.cs | 2 +- .../Vector256/LessThanOrEqualAny.UInt64.cs | 2 +- .../General/Vector256/Max.Byte.cs | 2 +- .../General/Vector256/Max.Double.cs | 2 +- .../General/Vector256/Max.Int16.cs | 2 +- .../General/Vector256/Max.Int32.cs | 2 +- .../General/Vector256/Max.Int64.cs | 2 +- .../General/Vector256/Max.SByte.cs | 2 +- .../General/Vector256/Max.Single.cs | 2 +- .../General/Vector256/Max.UInt16.cs | 2 +- .../General/Vector256/Max.UInt32.cs | 2 +- .../General/Vector256/Max.UInt64.cs | 2 +- .../General/Vector256/Min.Byte.cs | 2 +- .../General/Vector256/Min.Double.cs | 2 +- .../General/Vector256/Min.Int16.cs | 2 +- .../General/Vector256/Min.Int32.cs | 2 +- .../General/Vector256/Min.Int64.cs | 2 +- .../General/Vector256/Min.SByte.cs | 2 +- .../General/Vector256/Min.Single.cs | 2 +- .../General/Vector256/Min.UInt16.cs | 2 +- .../General/Vector256/Min.UInt32.cs | 2 +- .../General/Vector256/Min.UInt64.cs | 2 +- .../General/Vector256/Multiply.Byte.cs | 2 +- .../General/Vector256/Multiply.Double.cs | 2 +- .../General/Vector256/Multiply.Int16.cs | 2 +- .../General/Vector256/Multiply.Int32.cs | 2 +- .../General/Vector256/Multiply.Int64.cs | 2 +- .../General/Vector256/Multiply.SByte.cs | 2 +- .../General/Vector256/Multiply.Single.cs | 2 +- .../General/Vector256/Multiply.UInt16.cs | 2 +- .../General/Vector256/Multiply.UInt32.cs | 2 +- .../General/Vector256/Multiply.UInt64.cs | 2 +- .../General/Vector256/Narrow.Double.cs | 2 +- .../General/Vector256/Narrow.Int16.cs | 2 +- .../General/Vector256/Narrow.Int32.cs | 2 +- .../General/Vector256/Narrow.Int64.cs | 2 +- .../General/Vector256/Narrow.UInt16.cs | 2 +- .../General/Vector256/Narrow.UInt32.cs | 2 +- .../General/Vector256/Narrow.UInt64.cs | 2 +- .../General/Vector256/Negate.Byte.cs | 2 +- .../General/Vector256/Negate.Double.cs | 2 +- .../General/Vector256/Negate.Int16.cs | 2 +- .../General/Vector256/Negate.Int32.cs | 2 +- .../General/Vector256/Negate.Int64.cs | 2 +- .../General/Vector256/Negate.SByte.cs | 2 +- .../General/Vector256/Negate.Single.cs | 2 +- .../General/Vector256/Negate.UInt16.cs | 2 +- .../General/Vector256/Negate.UInt32.cs | 2 +- .../General/Vector256/Negate.UInt64.cs | 2 +- .../General/Vector256/OnesComplement.Byte.cs | 2 +- .../Vector256/OnesComplement.Double.cs | 2 +- .../General/Vector256/OnesComplement.Int16.cs | 2 +- .../General/Vector256/OnesComplement.Int32.cs | 2 +- .../General/Vector256/OnesComplement.Int64.cs | 2 +- .../General/Vector256/OnesComplement.SByte.cs | 2 +- .../Vector256/OnesComplement.Single.cs | 2 +- .../Vector256/OnesComplement.UInt16.cs | 2 +- .../Vector256/OnesComplement.UInt32.cs | 2 +- .../Vector256/OnesComplement.UInt64.cs | 2 +- .../General/Vector256/Sqrt.Byte.cs | 2 +- .../General/Vector256/Sqrt.Double.cs | 2 +- .../General/Vector256/Sqrt.Int16.cs | 2 +- .../General/Vector256/Sqrt.Int32.cs | 2 +- .../General/Vector256/Sqrt.Int64.cs | 2 +- .../General/Vector256/Sqrt.SByte.cs | 2 +- .../General/Vector256/Sqrt.Single.cs | 2 +- .../General/Vector256/Sqrt.UInt16.cs | 2 +- .../General/Vector256/Sqrt.UInt32.cs | 2 +- .../General/Vector256/Sqrt.UInt64.cs | 2 +- .../General/Vector256/Subtract.Byte.cs | 2 +- .../General/Vector256/Subtract.Double.cs | 2 +- .../General/Vector256/Subtract.Int16.cs | 2 +- .../General/Vector256/Subtract.Int32.cs | 2 +- .../General/Vector256/Subtract.Int64.cs | 2 +- .../General/Vector256/Subtract.SByte.cs | 2 +- .../General/Vector256/Subtract.Single.cs | 2 +- .../General/Vector256/Subtract.UInt16.cs | 2 +- .../General/Vector256/Subtract.UInt32.cs | 2 +- .../General/Vector256/Subtract.UInt64.cs | 2 +- .../General/Vector256/Widen.Double.cs | 2 +- .../General/Vector256/Widen.Int16.cs | 2 +- .../General/Vector256/Widen.Int32.cs | 2 +- .../General/Vector256/Widen.Int64.cs | 2 +- .../General/Vector256/Widen.UInt16.cs | 2 +- .../General/Vector256/Widen.UInt32.cs | 2 +- .../General/Vector256/Widen.UInt64.cs | 2 +- .../General/Vector256/Xor.Byte.cs | 2 +- .../General/Vector256/Xor.Double.cs | 2 +- .../General/Vector256/Xor.Int16.cs | 2 +- .../General/Vector256/Xor.Int32.cs | 2 +- .../General/Vector256/Xor.Int64.cs | 2 +- .../General/Vector256/Xor.SByte.cs | 2 +- .../General/Vector256/Xor.Single.cs | 2 +- .../General/Vector256/Xor.UInt16.cs | 2 +- .../General/Vector256/Xor.UInt32.cs | 2 +- .../General/Vector256/Xor.UInt64.cs | 2 +- .../Vector256_1/Program.Vector256_1.cs | 3 ++ .../General/Vector256_1/Vector256_1_r.csproj | 4 ++ .../General/Vector256_1/Vector256_1_ro.csproj | 4 ++ .../General/Vector256_1/op_Addition.Byte.cs | 2 +- .../General/Vector256_1/op_Addition.Double.cs | 2 +- .../General/Vector256_1/op_Addition.Int16.cs | 2 +- .../General/Vector256_1/op_Addition.Int32.cs | 2 +- .../General/Vector256_1/op_Addition.Int64.cs | 2 +- .../General/Vector256_1/op_Addition.SByte.cs | 2 +- .../General/Vector256_1/op_Addition.Single.cs | 2 +- .../General/Vector256_1/op_Addition.UInt16.cs | 2 +- .../General/Vector256_1/op_Addition.UInt32.cs | 2 +- .../General/Vector256_1/op_Addition.UInt64.cs | 2 +- .../General/Vector256_1/op_BitwiseAnd.Byte.cs | 2 +- .../Vector256_1/op_BitwiseAnd.Double.cs | 2 +- .../Vector256_1/op_BitwiseAnd.Int16.cs | 2 +- .../Vector256_1/op_BitwiseAnd.Int32.cs | 2 +- .../Vector256_1/op_BitwiseAnd.Int64.cs | 2 +- .../Vector256_1/op_BitwiseAnd.SByte.cs | 2 +- .../Vector256_1/op_BitwiseAnd.Single.cs | 2 +- .../Vector256_1/op_BitwiseAnd.UInt16.cs | 2 +- .../Vector256_1/op_BitwiseAnd.UInt32.cs | 2 +- .../Vector256_1/op_BitwiseAnd.UInt64.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.Byte.cs | 2 +- .../Vector256_1/op_BitwiseOr.Double.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.Int16.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.Int32.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.Int64.cs | 2 +- .../General/Vector256_1/op_BitwiseOr.SByte.cs | 2 +- .../Vector256_1/op_BitwiseOr.Single.cs | 2 +- .../Vector256_1/op_BitwiseOr.UInt16.cs | 2 +- .../Vector256_1/op_BitwiseOr.UInt32.cs | 2 +- .../Vector256_1/op_BitwiseOr.UInt64.cs | 2 +- .../General/Vector256_1/op_Division.Byte.cs | 2 +- .../General/Vector256_1/op_Division.Double.cs | 2 +- .../General/Vector256_1/op_Division.Int16.cs | 2 +- .../General/Vector256_1/op_Division.Int32.cs | 2 +- .../General/Vector256_1/op_Division.Int64.cs | 2 +- .../General/Vector256_1/op_Division.SByte.cs | 2 +- .../General/Vector256_1/op_Division.Single.cs | 2 +- .../General/Vector256_1/op_Division.UInt16.cs | 2 +- .../General/Vector256_1/op_Division.UInt32.cs | 2 +- .../General/Vector256_1/op_Division.UInt64.cs | 2 +- .../General/Vector256_1/op_Equality.Byte.cs | 2 +- .../General/Vector256_1/op_Equality.Double.cs | 2 +- .../General/Vector256_1/op_Equality.Int16.cs | 2 +- .../General/Vector256_1/op_Equality.Int32.cs | 2 +- .../General/Vector256_1/op_Equality.Int64.cs | 2 +- .../General/Vector256_1/op_Equality.SByte.cs | 2 +- .../General/Vector256_1/op_Equality.Single.cs | 2 +- .../General/Vector256_1/op_Equality.UInt16.cs | 2 +- .../General/Vector256_1/op_Equality.UInt32.cs | 2 +- .../General/Vector256_1/op_Equality.UInt64.cs | 2 +- .../Vector256_1/op_ExclusiveOr.Byte.cs | 2 +- .../Vector256_1/op_ExclusiveOr.Double.cs | 2 +- .../Vector256_1/op_ExclusiveOr.Int16.cs | 2 +- .../Vector256_1/op_ExclusiveOr.Int32.cs | 2 +- .../Vector256_1/op_ExclusiveOr.Int64.cs | 2 +- .../Vector256_1/op_ExclusiveOr.SByte.cs | 2 +- .../Vector256_1/op_ExclusiveOr.Single.cs | 2 +- .../Vector256_1/op_ExclusiveOr.UInt16.cs | 2 +- .../Vector256_1/op_ExclusiveOr.UInt32.cs | 2 +- .../Vector256_1/op_ExclusiveOr.UInt64.cs | 2 +- .../General/Vector256_1/op_Inequality.Byte.cs | 2 +- .../Vector256_1/op_Inequality.Double.cs | 2 +- .../Vector256_1/op_Inequality.Int16.cs | 2 +- .../Vector256_1/op_Inequality.Int32.cs | 2 +- .../Vector256_1/op_Inequality.Int64.cs | 2 +- .../Vector256_1/op_Inequality.SByte.cs | 2 +- .../Vector256_1/op_Inequality.Single.cs | 2 +- .../Vector256_1/op_Inequality.UInt16.cs | 2 +- .../Vector256_1/op_Inequality.UInt32.cs | 2 +- .../Vector256_1/op_Inequality.UInt64.cs | 2 +- .../General/Vector256_1/op_Multiply.Byte.cs | 2 +- .../General/Vector256_1/op_Multiply.Double.cs | 2 +- .../General/Vector256_1/op_Multiply.Int16.cs | 2 +- .../General/Vector256_1/op_Multiply.Int32.cs | 2 +- .../General/Vector256_1/op_Multiply.Int64.cs | 2 +- .../General/Vector256_1/op_Multiply.SByte.cs | 2 +- .../General/Vector256_1/op_Multiply.Single.cs | 2 +- .../General/Vector256_1/op_Multiply.UInt16.cs | 2 +- .../General/Vector256_1/op_Multiply.UInt32.cs | 2 +- .../General/Vector256_1/op_Multiply.UInt64.cs | 2 +- .../Vector256_1/op_OnesComplement.Byte.cs | 2 +- .../Vector256_1/op_OnesComplement.Double.cs | 2 +- .../Vector256_1/op_OnesComplement.Int16.cs | 2 +- .../Vector256_1/op_OnesComplement.Int32.cs | 2 +- .../Vector256_1/op_OnesComplement.Int64.cs | 2 +- .../Vector256_1/op_OnesComplement.SByte.cs | 2 +- .../Vector256_1/op_OnesComplement.Single.cs | 2 +- .../Vector256_1/op_OnesComplement.UInt16.cs | 2 +- .../Vector256_1/op_OnesComplement.UInt32.cs | 2 +- .../Vector256_1/op_OnesComplement.UInt64.cs | 2 +- .../Vector256_1/op_Subtraction.Byte.cs | 2 +- .../Vector256_1/op_Subtraction.Double.cs | 2 +- .../Vector256_1/op_Subtraction.Int16.cs | 2 +- .../Vector256_1/op_Subtraction.Int32.cs | 2 +- .../Vector256_1/op_Subtraction.Int64.cs | 2 +- .../Vector256_1/op_Subtraction.SByte.cs | 2 +- .../Vector256_1/op_Subtraction.Single.cs | 2 +- .../Vector256_1/op_Subtraction.UInt16.cs | 2 +- .../Vector256_1/op_Subtraction.UInt32.cs | 2 +- .../Vector256_1/op_Subtraction.UInt64.cs | 2 +- .../Vector256_1/op_UnaryNegation.Byte.cs | 2 +- .../Vector256_1/op_UnaryNegation.Double.cs | 2 +- .../Vector256_1/op_UnaryNegation.Int16.cs | 2 +- .../Vector256_1/op_UnaryNegation.Int32.cs | 2 +- .../Vector256_1/op_UnaryNegation.Int64.cs | 2 +- .../Vector256_1/op_UnaryNegation.SByte.cs | 2 +- .../Vector256_1/op_UnaryNegation.Single.cs | 2 +- .../Vector256_1/op_UnaryNegation.UInt16.cs | 2 +- .../Vector256_1/op_UnaryNegation.UInt32.cs | 2 +- .../Vector256_1/op_UnaryNegation.UInt64.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.Byte.cs | 2 +- .../Vector256_1/op_UnaryPlus.Double.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.Int16.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.Int32.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.Int64.cs | 2 +- .../General/Vector256_1/op_UnaryPlus.SByte.cs | 2 +- .../Vector256_1/op_UnaryPlus.Single.cs | 2 +- .../Vector256_1/op_UnaryPlus.UInt16.cs | 2 +- .../Vector256_1/op_UnaryPlus.UInt32.cs | 2 +- .../Vector256_1/op_UnaryPlus.UInt64.cs | 2 +- .../General/Vector64/Abs.Byte.cs | 2 +- .../General/Vector64/Abs.Double.cs | 2 +- .../General/Vector64/Abs.Int16.cs | 2 +- .../General/Vector64/Abs.Int32.cs | 2 +- .../General/Vector64/Abs.Int64.cs | 2 +- .../General/Vector64/Abs.SByte.cs | 2 +- .../General/Vector64/Abs.Single.cs | 2 +- .../General/Vector64/Abs.UInt16.cs | 2 +- .../General/Vector64/Abs.UInt32.cs | 2 +- .../General/Vector64/Abs.UInt64.cs | 2 +- .../General/Vector64/Add.Byte.cs | 2 +- .../General/Vector64/Add.Double.cs | 2 +- .../General/Vector64/Add.Int16.cs | 2 +- .../General/Vector64/Add.Int32.cs | 2 +- .../General/Vector64/Add.Int64.cs | 2 +- .../General/Vector64/Add.SByte.cs | 2 +- .../General/Vector64/Add.Single.cs | 2 +- .../General/Vector64/Add.UInt16.cs | 2 +- .../General/Vector64/Add.UInt32.cs | 2 +- .../General/Vector64/Add.UInt64.cs | 2 +- .../General/Vector64/AndNot.Byte.cs | 2 +- .../General/Vector64/AndNot.Double.cs | 2 +- .../General/Vector64/AndNot.Int16.cs | 2 +- .../General/Vector64/AndNot.Int32.cs | 2 +- .../General/Vector64/AndNot.Int64.cs | 2 +- .../General/Vector64/AndNot.SByte.cs | 2 +- .../General/Vector64/AndNot.Single.cs | 2 +- .../General/Vector64/AndNot.UInt16.cs | 2 +- .../General/Vector64/AndNot.UInt32.cs | 2 +- .../General/Vector64/AndNot.UInt64.cs | 2 +- .../General/Vector64/BitwiseAnd.Byte.cs | 2 +- .../General/Vector64/BitwiseAnd.Double.cs | 2 +- .../General/Vector64/BitwiseAnd.Int16.cs | 2 +- .../General/Vector64/BitwiseAnd.Int32.cs | 2 +- .../General/Vector64/BitwiseAnd.Int64.cs | 2 +- .../General/Vector64/BitwiseAnd.SByte.cs | 2 +- .../General/Vector64/BitwiseAnd.Single.cs | 2 +- .../General/Vector64/BitwiseAnd.UInt16.cs | 2 +- .../General/Vector64/BitwiseAnd.UInt32.cs | 2 +- .../General/Vector64/BitwiseAnd.UInt64.cs | 2 +- .../General/Vector64/BitwiseOr.Byte.cs | 2 +- .../General/Vector64/BitwiseOr.Double.cs | 2 +- .../General/Vector64/BitwiseOr.Int16.cs | 2 +- .../General/Vector64/BitwiseOr.Int32.cs | 2 +- .../General/Vector64/BitwiseOr.Int64.cs | 2 +- .../General/Vector64/BitwiseOr.SByte.cs | 2 +- .../General/Vector64/BitwiseOr.Single.cs | 2 +- .../General/Vector64/BitwiseOr.UInt16.cs | 2 +- .../General/Vector64/BitwiseOr.UInt32.cs | 2 +- .../General/Vector64/BitwiseOr.UInt64.cs | 2 +- .../General/Vector64/Ceiling.Double.cs | 2 +- .../General/Vector64/Ceiling.Single.cs | 2 +- .../Vector64/ConditionalSelect.Byte.cs | 2 +- .../Vector64/ConditionalSelect.Double.cs | 2 +- .../Vector64/ConditionalSelect.Int16.cs | 2 +- .../Vector64/ConditionalSelect.Int32.cs | 2 +- .../Vector64/ConditionalSelect.Int64.cs | 2 +- .../Vector64/ConditionalSelect.SByte.cs | 2 +- .../Vector64/ConditionalSelect.Single.cs | 2 +- .../Vector64/ConditionalSelect.UInt16.cs | 2 +- .../Vector64/ConditionalSelect.UInt32.cs | 2 +- .../Vector64/ConditionalSelect.UInt64.cs | 2 +- .../General/Vector64/ConvertToDouble.Int64.cs | 2 +- .../Vector64/ConvertToDouble.UInt64.cs | 2 +- .../General/Vector64/ConvertToInt32.Single.cs | 2 +- .../General/Vector64/ConvertToInt64.Double.cs | 2 +- .../General/Vector64/ConvertToSingle.Int32.cs | 2 +- .../Vector64/ConvertToSingle.UInt32.cs | 2 +- .../Vector64/ConvertToUInt32.Single.cs | 2 +- .../Vector64/ConvertToUInt64.Double.cs | 2 +- .../General/Vector64/Divide.Byte.cs | 2 +- .../General/Vector64/Divide.Double.cs | 2 +- .../General/Vector64/Divide.Int16.cs | 2 +- .../General/Vector64/Divide.Int32.cs | 2 +- .../General/Vector64/Divide.Int64.cs | 2 +- .../General/Vector64/Divide.SByte.cs | 2 +- .../General/Vector64/Divide.Single.cs | 2 +- .../General/Vector64/Divide.UInt16.cs | 2 +- .../General/Vector64/Divide.UInt32.cs | 2 +- .../General/Vector64/Divide.UInt64.cs | 2 +- .../General/Vector64/Dot.Byte.cs | 42 +++++++----------- .../General/Vector64/Dot.Double.cs | 42 +++++++----------- .../General/Vector64/Dot.Int16.cs | 42 +++++++----------- .../General/Vector64/Dot.Int32.cs | 42 +++++++----------- .../General/Vector64/Dot.Int64.cs | 42 +++++++----------- .../General/Vector64/Dot.SByte.cs | 42 +++++++----------- .../General/Vector64/Dot.Single.cs | 42 +++++++----------- .../General/Vector64/Dot.UInt16.cs | 42 +++++++----------- .../General/Vector64/Dot.UInt32.cs | 42 +++++++----------- .../General/Vector64/Dot.UInt64.cs | 42 +++++++----------- .../General/Vector64/Equals.Byte.cs | 2 +- .../General/Vector64/Equals.Double.cs | 2 +- .../General/Vector64/Equals.Int16.cs | 2 +- .../General/Vector64/Equals.Int32.cs | 2 +- .../General/Vector64/Equals.Int64.cs | 2 +- .../General/Vector64/Equals.SByte.cs | 2 +- .../General/Vector64/Equals.Single.cs | 2 +- .../General/Vector64/Equals.UInt16.cs | 2 +- .../General/Vector64/Equals.UInt32.cs | 2 +- .../General/Vector64/Equals.UInt64.cs | 2 +- .../General/Vector64/EqualsAll.Byte.cs | 2 +- .../General/Vector64/EqualsAll.Double.cs | 2 +- .../General/Vector64/EqualsAll.Int16.cs | 2 +- .../General/Vector64/EqualsAll.Int32.cs | 2 +- .../General/Vector64/EqualsAll.Int64.cs | 2 +- .../General/Vector64/EqualsAll.SByte.cs | 2 +- .../General/Vector64/EqualsAll.Single.cs | 2 +- .../General/Vector64/EqualsAll.UInt16.cs | 2 +- .../General/Vector64/EqualsAll.UInt32.cs | 2 +- .../General/Vector64/EqualsAll.UInt64.cs | 2 +- .../General/Vector64/EqualsAny.Byte.cs | 2 +- .../General/Vector64/EqualsAny.Double.cs | 2 +- .../General/Vector64/EqualsAny.Int16.cs | 2 +- .../General/Vector64/EqualsAny.Int32.cs | 2 +- .../General/Vector64/EqualsAny.Int64.cs | 2 +- .../General/Vector64/EqualsAny.SByte.cs | 2 +- .../General/Vector64/EqualsAny.Single.cs | 2 +- .../General/Vector64/EqualsAny.UInt16.cs | 2 +- .../General/Vector64/EqualsAny.UInt32.cs | 2 +- .../General/Vector64/EqualsAny.UInt64.cs | 2 +- .../General/Vector64/Floor.Double.cs | 2 +- .../General/Vector64/Floor.Single.cs | 2 +- .../General/Vector64/GreaterThan.Byte.cs | 2 +- .../General/Vector64/GreaterThan.Double.cs | 2 +- .../General/Vector64/GreaterThan.Int16.cs | 2 +- .../General/Vector64/GreaterThan.Int32.cs | 2 +- .../General/Vector64/GreaterThan.Int64.cs | 2 +- .../General/Vector64/GreaterThan.SByte.cs | 2 +- .../General/Vector64/GreaterThan.Single.cs | 2 +- .../General/Vector64/GreaterThan.UInt16.cs | 2 +- .../General/Vector64/GreaterThan.UInt32.cs | 2 +- .../General/Vector64/GreaterThan.UInt64.cs | 2 +- .../General/Vector64/GreaterThanAll.Byte.cs | 2 +- .../General/Vector64/GreaterThanAll.Double.cs | 2 +- .../General/Vector64/GreaterThanAll.Int16.cs | 2 +- .../General/Vector64/GreaterThanAll.Int32.cs | 2 +- .../General/Vector64/GreaterThanAll.Int64.cs | 2 +- .../General/Vector64/GreaterThanAll.SByte.cs | 2 +- .../General/Vector64/GreaterThanAll.Single.cs | 2 +- .../General/Vector64/GreaterThanAll.UInt16.cs | 2 +- .../General/Vector64/GreaterThanAll.UInt32.cs | 2 +- .../General/Vector64/GreaterThanAll.UInt64.cs | 2 +- .../General/Vector64/GreaterThanAny.Byte.cs | 2 +- .../General/Vector64/GreaterThanAny.Double.cs | 2 +- .../General/Vector64/GreaterThanAny.Int16.cs | 2 +- .../General/Vector64/GreaterThanAny.Int32.cs | 2 +- .../General/Vector64/GreaterThanAny.Int64.cs | 2 +- .../General/Vector64/GreaterThanAny.SByte.cs | 2 +- .../General/Vector64/GreaterThanAny.Single.cs | 2 +- .../General/Vector64/GreaterThanAny.UInt16.cs | 2 +- .../General/Vector64/GreaterThanAny.UInt32.cs | 2 +- .../General/Vector64/GreaterThanAny.UInt64.cs | 2 +- .../Vector64/GreaterThanOrEqual.Byte.cs | 2 +- .../Vector64/GreaterThanOrEqual.Double.cs | 2 +- .../Vector64/GreaterThanOrEqual.Int16.cs | 2 +- .../Vector64/GreaterThanOrEqual.Int32.cs | 2 +- .../Vector64/GreaterThanOrEqual.Int64.cs | 2 +- .../Vector64/GreaterThanOrEqual.SByte.cs | 2 +- .../Vector64/GreaterThanOrEqual.Single.cs | 2 +- .../Vector64/GreaterThanOrEqual.UInt16.cs | 2 +- .../Vector64/GreaterThanOrEqual.UInt32.cs | 2 +- .../Vector64/GreaterThanOrEqual.UInt64.cs | 2 +- .../Vector64/GreaterThanOrEqualAll.Byte.cs | 2 +- .../Vector64/GreaterThanOrEqualAll.Double.cs | 2 +- .../Vector64/GreaterThanOrEqualAll.Int16.cs | 2 +- .../Vector64/GreaterThanOrEqualAll.Int32.cs | 2 +- .../Vector64/GreaterThanOrEqualAll.Int64.cs | 2 +- .../Vector64/GreaterThanOrEqualAll.SByte.cs | 2 +- .../Vector64/GreaterThanOrEqualAll.Single.cs | 2 +- .../Vector64/GreaterThanOrEqualAll.UInt16.cs | 2 +- .../Vector64/GreaterThanOrEqualAll.UInt32.cs | 2 +- .../Vector64/GreaterThanOrEqualAll.UInt64.cs | 2 +- .../Vector64/GreaterThanOrEqualAny.Byte.cs | 2 +- .../Vector64/GreaterThanOrEqualAny.Double.cs | 2 +- .../Vector64/GreaterThanOrEqualAny.Int16.cs | 2 +- .../Vector64/GreaterThanOrEqualAny.Int32.cs | 2 +- .../Vector64/GreaterThanOrEqualAny.Int64.cs | 2 +- .../Vector64/GreaterThanOrEqualAny.SByte.cs | 2 +- .../Vector64/GreaterThanOrEqualAny.Single.cs | 2 +- .../Vector64/GreaterThanOrEqualAny.UInt16.cs | 2 +- .../Vector64/GreaterThanOrEqualAny.UInt32.cs | 2 +- .../Vector64/GreaterThanOrEqualAny.UInt64.cs | 2 +- .../General/Vector64/LessThan.Byte.cs | 2 +- .../General/Vector64/LessThan.Double.cs | 2 +- .../General/Vector64/LessThan.Int16.cs | 2 +- .../General/Vector64/LessThan.Int32.cs | 2 +- .../General/Vector64/LessThan.Int64.cs | 2 +- .../General/Vector64/LessThan.SByte.cs | 2 +- .../General/Vector64/LessThan.Single.cs | 2 +- .../General/Vector64/LessThan.UInt16.cs | 2 +- .../General/Vector64/LessThan.UInt32.cs | 2 +- .../General/Vector64/LessThan.UInt64.cs | 2 +- .../General/Vector64/LessThanAll.Byte.cs | 2 +- .../General/Vector64/LessThanAll.Double.cs | 2 +- .../General/Vector64/LessThanAll.Int16.cs | 2 +- .../General/Vector64/LessThanAll.Int32.cs | 2 +- .../General/Vector64/LessThanAll.Int64.cs | 2 +- .../General/Vector64/LessThanAll.SByte.cs | 2 +- .../General/Vector64/LessThanAll.Single.cs | 2 +- .../General/Vector64/LessThanAll.UInt16.cs | 2 +- .../General/Vector64/LessThanAll.UInt32.cs | 2 +- .../General/Vector64/LessThanAll.UInt64.cs | 2 +- .../General/Vector64/LessThanAny.Byte.cs | 2 +- .../General/Vector64/LessThanAny.Double.cs | 2 +- .../General/Vector64/LessThanAny.Int16.cs | 2 +- .../General/Vector64/LessThanAny.Int32.cs | 2 +- .../General/Vector64/LessThanAny.Int64.cs | 2 +- .../General/Vector64/LessThanAny.SByte.cs | 2 +- .../General/Vector64/LessThanAny.Single.cs | 2 +- .../General/Vector64/LessThanAny.UInt16.cs | 2 +- .../General/Vector64/LessThanAny.UInt32.cs | 2 +- .../General/Vector64/LessThanAny.UInt64.cs | 2 +- .../General/Vector64/LessThanOrEqual.Byte.cs | 2 +- .../Vector64/LessThanOrEqual.Double.cs | 2 +- .../General/Vector64/LessThanOrEqual.Int16.cs | 2 +- .../General/Vector64/LessThanOrEqual.Int32.cs | 2 +- .../General/Vector64/LessThanOrEqual.Int64.cs | 2 +- .../General/Vector64/LessThanOrEqual.SByte.cs | 2 +- .../Vector64/LessThanOrEqual.Single.cs | 2 +- .../Vector64/LessThanOrEqual.UInt16.cs | 2 +- .../Vector64/LessThanOrEqual.UInt32.cs | 2 +- .../Vector64/LessThanOrEqual.UInt64.cs | 2 +- .../Vector64/LessThanOrEqualAll.Byte.cs | 2 +- .../Vector64/LessThanOrEqualAll.Double.cs | 2 +- .../Vector64/LessThanOrEqualAll.Int16.cs | 2 +- .../Vector64/LessThanOrEqualAll.Int32.cs | 2 +- .../Vector64/LessThanOrEqualAll.Int64.cs | 2 +- .../Vector64/LessThanOrEqualAll.SByte.cs | 2 +- .../Vector64/LessThanOrEqualAll.Single.cs | 2 +- .../Vector64/LessThanOrEqualAll.UInt16.cs | 2 +- .../Vector64/LessThanOrEqualAll.UInt32.cs | 2 +- .../Vector64/LessThanOrEqualAll.UInt64.cs | 2 +- .../Vector64/LessThanOrEqualAny.Byte.cs | 2 +- .../Vector64/LessThanOrEqualAny.Double.cs | 2 +- .../Vector64/LessThanOrEqualAny.Int16.cs | 2 +- .../Vector64/LessThanOrEqualAny.Int32.cs | 2 +- .../Vector64/LessThanOrEqualAny.Int64.cs | 2 +- .../Vector64/LessThanOrEqualAny.SByte.cs | 2 +- .../Vector64/LessThanOrEqualAny.Single.cs | 2 +- .../Vector64/LessThanOrEqualAny.UInt16.cs | 2 +- .../Vector64/LessThanOrEqualAny.UInt32.cs | 2 +- .../Vector64/LessThanOrEqualAny.UInt64.cs | 2 +- .../General/Vector64/Max.Byte.cs | 2 +- .../General/Vector64/Max.Double.cs | 2 +- .../General/Vector64/Max.Int16.cs | 2 +- .../General/Vector64/Max.Int32.cs | 2 +- .../General/Vector64/Max.Int64.cs | 2 +- .../General/Vector64/Max.SByte.cs | 2 +- .../General/Vector64/Max.Single.cs | 2 +- .../General/Vector64/Max.UInt16.cs | 2 +- .../General/Vector64/Max.UInt32.cs | 2 +- .../General/Vector64/Max.UInt64.cs | 2 +- .../General/Vector64/Min.Byte.cs | 2 +- .../General/Vector64/Min.Double.cs | 2 +- .../General/Vector64/Min.Int16.cs | 2 +- .../General/Vector64/Min.Int32.cs | 2 +- .../General/Vector64/Min.Int64.cs | 2 +- .../General/Vector64/Min.SByte.cs | 2 +- .../General/Vector64/Min.Single.cs | 2 +- .../General/Vector64/Min.UInt16.cs | 2 +- .../General/Vector64/Min.UInt32.cs | 2 +- .../General/Vector64/Min.UInt64.cs | 2 +- .../General/Vector64/Multiply.Byte.cs | 2 +- .../General/Vector64/Multiply.Double.cs | 2 +- .../General/Vector64/Multiply.Int16.cs | 2 +- .../General/Vector64/Multiply.Int32.cs | 2 +- .../General/Vector64/Multiply.Int64.cs | 2 +- .../General/Vector64/Multiply.SByte.cs | 2 +- .../General/Vector64/Multiply.Single.cs | 2 +- .../General/Vector64/Multiply.UInt16.cs | 2 +- .../General/Vector64/Multiply.UInt32.cs | 2 +- .../General/Vector64/Multiply.UInt64.cs | 2 +- .../General/Vector64/Narrow.Double.cs | 2 +- .../General/Vector64/Narrow.Int16.cs | 2 +- .../General/Vector64/Narrow.Int32.cs | 2 +- .../General/Vector64/Narrow.Int64.cs | 2 +- .../General/Vector64/Narrow.UInt16.cs | 2 +- .../General/Vector64/Narrow.UInt32.cs | 2 +- .../General/Vector64/Narrow.UInt64.cs | 2 +- .../General/Vector64/Negate.Byte.cs | 2 +- .../General/Vector64/Negate.Double.cs | 2 +- .../General/Vector64/Negate.Int16.cs | 2 +- .../General/Vector64/Negate.Int32.cs | 2 +- .../General/Vector64/Negate.Int64.cs | 2 +- .../General/Vector64/Negate.SByte.cs | 2 +- .../General/Vector64/Negate.Single.cs | 2 +- .../General/Vector64/Negate.UInt16.cs | 2 +- .../General/Vector64/Negate.UInt32.cs | 2 +- .../General/Vector64/Negate.UInt64.cs | 2 +- .../General/Vector64/OnesComplement.Byte.cs | 2 +- .../General/Vector64/OnesComplement.Double.cs | 2 +- .../General/Vector64/OnesComplement.Int16.cs | 2 +- .../General/Vector64/OnesComplement.Int32.cs | 2 +- .../General/Vector64/OnesComplement.Int64.cs | 2 +- .../General/Vector64/OnesComplement.SByte.cs | 2 +- .../General/Vector64/OnesComplement.Single.cs | 2 +- .../General/Vector64/OnesComplement.UInt16.cs | 2 +- .../General/Vector64/OnesComplement.UInt32.cs | 2 +- .../General/Vector64/OnesComplement.UInt64.cs | 2 +- .../General/Vector64/Sqrt.Byte.cs | 2 +- .../General/Vector64/Sqrt.Double.cs | 2 +- .../General/Vector64/Sqrt.Int16.cs | 2 +- .../General/Vector64/Sqrt.Int32.cs | 2 +- .../General/Vector64/Sqrt.Int64.cs | 2 +- .../General/Vector64/Sqrt.SByte.cs | 2 +- .../General/Vector64/Sqrt.Single.cs | 2 +- .../General/Vector64/Sqrt.UInt16.cs | 2 +- .../General/Vector64/Sqrt.UInt32.cs | 2 +- .../General/Vector64/Sqrt.UInt64.cs | 2 +- .../General/Vector64/Subtract.Byte.cs | 2 +- .../General/Vector64/Subtract.Double.cs | 2 +- .../General/Vector64/Subtract.Int16.cs | 2 +- .../General/Vector64/Subtract.Int32.cs | 2 +- .../General/Vector64/Subtract.Int64.cs | 2 +- .../General/Vector64/Subtract.SByte.cs | 2 +- .../General/Vector64/Subtract.Single.cs | 2 +- .../General/Vector64/Subtract.UInt16.cs | 2 +- .../General/Vector64/Subtract.UInt32.cs | 2 +- .../General/Vector64/Subtract.UInt64.cs | 2 +- .../General/Vector64/Widen.Double.cs | 2 +- .../General/Vector64/Widen.Int16.cs | 2 +- .../General/Vector64/Widen.Int32.cs | 2 +- .../General/Vector64/Widen.Int64.cs | 2 +- .../General/Vector64/Widen.UInt16.cs | 2 +- .../General/Vector64/Widen.UInt32.cs | 2 +- .../General/Vector64/Widen.UInt64.cs | 2 +- .../General/Vector64/Xor.Byte.cs | 2 +- .../General/Vector64/Xor.Double.cs | 2 +- .../General/Vector64/Xor.Int16.cs | 2 +- .../General/Vector64/Xor.Int32.cs | 2 +- .../General/Vector64/Xor.Int64.cs | 2 +- .../General/Vector64/Xor.SByte.cs | 2 +- .../General/Vector64/Xor.Single.cs | 2 +- .../General/Vector64/Xor.UInt16.cs | 2 +- .../General/Vector64/Xor.UInt32.cs | 2 +- .../General/Vector64/Xor.UInt64.cs | 2 +- .../General/Vector64_1/op_Addition.Byte.cs | 2 +- .../General/Vector64_1/op_Addition.Double.cs | 2 +- .../General/Vector64_1/op_Addition.Int16.cs | 2 +- .../General/Vector64_1/op_Addition.Int32.cs | 2 +- .../General/Vector64_1/op_Addition.Int64.cs | 2 +- .../General/Vector64_1/op_Addition.SByte.cs | 2 +- .../General/Vector64_1/op_Addition.Single.cs | 2 +- .../General/Vector64_1/op_Addition.UInt16.cs | 2 +- .../General/Vector64_1/op_Addition.UInt32.cs | 2 +- .../General/Vector64_1/op_Addition.UInt64.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.Byte.cs | 2 +- .../Vector64_1/op_BitwiseAnd.Double.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.Int16.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.Int32.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.Int64.cs | 2 +- .../General/Vector64_1/op_BitwiseAnd.SByte.cs | 2 +- .../Vector64_1/op_BitwiseAnd.Single.cs | 2 +- .../Vector64_1/op_BitwiseAnd.UInt16.cs | 2 +- .../Vector64_1/op_BitwiseAnd.UInt32.cs | 2 +- .../Vector64_1/op_BitwiseAnd.UInt64.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.Byte.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.Double.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.Int16.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.Int32.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.Int64.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.SByte.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.Single.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.UInt16.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.UInt32.cs | 2 +- .../General/Vector64_1/op_BitwiseOr.UInt64.cs | 2 +- .../General/Vector64_1/op_Division.Byte.cs | 2 +- .../General/Vector64_1/op_Division.Double.cs | 2 +- .../General/Vector64_1/op_Division.Int16.cs | 2 +- .../General/Vector64_1/op_Division.Int32.cs | 2 +- .../General/Vector64_1/op_Division.Int64.cs | 2 +- .../General/Vector64_1/op_Division.SByte.cs | 2 +- .../General/Vector64_1/op_Division.Single.cs | 2 +- .../General/Vector64_1/op_Division.UInt16.cs | 2 +- .../General/Vector64_1/op_Division.UInt32.cs | 2 +- .../General/Vector64_1/op_Division.UInt64.cs | 2 +- .../General/Vector64_1/op_Equality.Byte.cs | 2 +- .../General/Vector64_1/op_Equality.Double.cs | 2 +- .../General/Vector64_1/op_Equality.Int16.cs | 2 +- .../General/Vector64_1/op_Equality.Int32.cs | 2 +- .../General/Vector64_1/op_Equality.Int64.cs | 2 +- .../General/Vector64_1/op_Equality.SByte.cs | 2 +- .../General/Vector64_1/op_Equality.Single.cs | 2 +- .../General/Vector64_1/op_Equality.UInt16.cs | 2 +- .../General/Vector64_1/op_Equality.UInt32.cs | 2 +- .../General/Vector64_1/op_Equality.UInt64.cs | 2 +- .../General/Vector64_1/op_ExclusiveOr.Byte.cs | 2 +- .../Vector64_1/op_ExclusiveOr.Double.cs | 2 +- .../Vector64_1/op_ExclusiveOr.Int16.cs | 2 +- .../Vector64_1/op_ExclusiveOr.Int32.cs | 2 +- .../Vector64_1/op_ExclusiveOr.Int64.cs | 2 +- .../Vector64_1/op_ExclusiveOr.SByte.cs | 2 +- .../Vector64_1/op_ExclusiveOr.Single.cs | 2 +- .../Vector64_1/op_ExclusiveOr.UInt16.cs | 2 +- .../Vector64_1/op_ExclusiveOr.UInt32.cs | 2 +- .../Vector64_1/op_ExclusiveOr.UInt64.cs | 2 +- .../General/Vector64_1/op_Inequality.Byte.cs | 2 +- .../Vector64_1/op_Inequality.Double.cs | 2 +- .../General/Vector64_1/op_Inequality.Int16.cs | 2 +- .../General/Vector64_1/op_Inequality.Int32.cs | 2 +- .../General/Vector64_1/op_Inequality.Int64.cs | 2 +- .../General/Vector64_1/op_Inequality.SByte.cs | 2 +- .../Vector64_1/op_Inequality.Single.cs | 2 +- .../Vector64_1/op_Inequality.UInt16.cs | 2 +- .../Vector64_1/op_Inequality.UInt32.cs | 2 +- .../Vector64_1/op_Inequality.UInt64.cs | 2 +- .../General/Vector64_1/op_Multiply.Byte.cs | 2 +- .../General/Vector64_1/op_Multiply.Double.cs | 2 +- .../General/Vector64_1/op_Multiply.Int16.cs | 2 +- .../General/Vector64_1/op_Multiply.Int32.cs | 2 +- .../General/Vector64_1/op_Multiply.Int64.cs | 2 +- .../General/Vector64_1/op_Multiply.SByte.cs | 2 +- .../General/Vector64_1/op_Multiply.Single.cs | 2 +- .../General/Vector64_1/op_Multiply.UInt16.cs | 2 +- .../General/Vector64_1/op_Multiply.UInt32.cs | 2 +- .../General/Vector64_1/op_Multiply.UInt64.cs | 2 +- .../Vector64_1/op_OnesComplement.Byte.cs | 2 +- .../Vector64_1/op_OnesComplement.Double.cs | 2 +- .../Vector64_1/op_OnesComplement.Int16.cs | 2 +- .../Vector64_1/op_OnesComplement.Int32.cs | 2 +- .../Vector64_1/op_OnesComplement.Int64.cs | 2 +- .../Vector64_1/op_OnesComplement.SByte.cs | 2 +- .../Vector64_1/op_OnesComplement.Single.cs | 2 +- .../Vector64_1/op_OnesComplement.UInt16.cs | 2 +- .../Vector64_1/op_OnesComplement.UInt32.cs | 2 +- .../Vector64_1/op_OnesComplement.UInt64.cs | 2 +- .../General/Vector64_1/op_Subtraction.Byte.cs | 2 +- .../Vector64_1/op_Subtraction.Double.cs | 2 +- .../Vector64_1/op_Subtraction.Int16.cs | 2 +- .../Vector64_1/op_Subtraction.Int32.cs | 2 +- .../Vector64_1/op_Subtraction.Int64.cs | 2 +- .../Vector64_1/op_Subtraction.SByte.cs | 2 +- .../Vector64_1/op_Subtraction.Single.cs | 2 +- .../Vector64_1/op_Subtraction.UInt16.cs | 2 +- .../Vector64_1/op_Subtraction.UInt32.cs | 2 +- .../Vector64_1/op_Subtraction.UInt64.cs | 2 +- .../Vector64_1/op_UnaryNegation.Byte.cs | 2 +- .../Vector64_1/op_UnaryNegation.Double.cs | 2 +- .../Vector64_1/op_UnaryNegation.Int16.cs | 2 +- .../Vector64_1/op_UnaryNegation.Int32.cs | 2 +- .../Vector64_1/op_UnaryNegation.Int64.cs | 2 +- .../Vector64_1/op_UnaryNegation.SByte.cs | 2 +- .../Vector64_1/op_UnaryNegation.Single.cs | 2 +- .../Vector64_1/op_UnaryNegation.UInt16.cs | 2 +- .../Vector64_1/op_UnaryNegation.UInt32.cs | 2 +- .../Vector64_1/op_UnaryNegation.UInt64.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.Byte.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.Double.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.Int16.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.Int32.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.Int64.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.SByte.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.Single.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.UInt16.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.UInt32.cs | 2 +- .../General/Vector64_1/op_UnaryPlus.UInt64.cs | 2 +- 1372 files changed, 1808 insertions(+), 2148 deletions(-) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Byte.cs index 5fdf63e3b26062..c90ef73bde81b3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Double.cs index a7570d23b933f9..39df712f047bbb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int16.cs index 47f3457903e96b..3c0cc77563f915 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int32.cs index 04e43fba93ffdb..f5c38e174ddc37 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int64.cs index b86384bcaf0b1c..4afbe8fabd1e09 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.SByte.cs index f90ff28adb3157..62741fe71bb97e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Single.cs index ffb4b35f9b67a4..74c33888fed69a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt16.cs index d658093561d0fa..fc09bd6ccbf0c0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt32.cs index 08e1915c583f68..4456d04a9f86d5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt64.cs index 6d2625b77af20f..055bc389676b19 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Abs.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Byte.cs index 1099b23ef95c23..edb167ee7013bd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Double.cs index 8a4ff68e0850b1..1324cd83ba689e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int16.cs index 65f384a4f0b327..247b3cc6f6011c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int32.cs index adaf0e9f986025..37076fafe4970d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int64.cs index f51eba03ca0816..1381f64a81b2e6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.SByte.cs index 92dec6f9ae014e..02124abf29616c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Single.cs index 3e6c884113d00a..d3f17641ce5d17 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt16.cs index 10ea648f7066d4..bae4bc57cd3fa8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt32.cs index 187657e0cf2c29..06bcab41e3b71e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt64.cs index 794965f70434be..fa710e59ccf60e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Add.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Byte.cs index 7ebcea462fe682..305481065cd900 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Double.cs index ed20d6a83161dd..fb2ed8424ea7f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int16.cs index ee5f4564d76916..6a060ac07b4d69 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int32.cs index 425f572535a9f8..414100a3f35ff3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int64.cs index 2e725ef77512f1..95a0841a3f07f2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.SByte.cs index 1e1514ebd3c709..91e9c67e530687 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Single.cs index dc379796db278b..0e59cc59ec4ccd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt16.cs index 0528306bad33d9..f3019686820c1f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt32.cs index 615d6b466c614e..7454d5a76e7037 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt64.cs index 00efd84e8fee78..ff4306f10f8974 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Byte.cs index f797863f56f14a..2dbec5f21d5d89 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Double.cs index 50717cfe31faf1..e7d81f1e4a2d29 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int16.cs index 744007ac4bb815..3b3f19e037d838 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int32.cs index 9deacd5e6d94fc..812de3673a8a83 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int64.cs index 9c2a8bc041177e..a1979a1a54ab5d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.SByte.cs index 29ed92df7da413..3151be099cca70 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Single.cs index 3c2aa493be1be0..db9b160dcfbd1e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt16.cs index 2e47385e39d053..fcccde59ccee40 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt32.cs index d6718cd7dfe97b..d3e76ac7d259b7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt64.cs index 0898f456d8e902..3d1de997692500 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Byte.cs index ed695ece044eff..35b3c8c3e23af3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Double.cs index 0552e6548c07f3..65b19d3a490b9c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int16.cs index 20eab5ab5f1a32..8c8cc9691df0ff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int32.cs index 70fdc2e662184a..7cdd7d9c8ed8f4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int64.cs index b2cd189b80dc01..3a5ffbd4c079c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.SByte.cs index c3029516c382c2..26b2944525ee73 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Single.cs index 172fbd6031d774..d412ab1ff76925 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt16.cs index c47b106408fdb6..d2484b533dcf4c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt32.cs index bc18b98d24c2aa..9e61d64c898717 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt64.cs index 5b1909f5b7222b..0f8adde32fc106 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Double.cs index 6caea1097c7cec..9f14dca16fd2e0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Single.cs index 9f51b97b7fb1ff..3258ff3b9a50c4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Ceiling.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Byte.cs index ea7f495d37f4fd..d716026c024d88 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Byte.cs @@ -76,7 +76,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] inArray3, Byte[] outAr int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Double.cs index c733bec8a38452..2cb7f6467a3d36 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Double.cs @@ -76,7 +76,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] inArray3, Double int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int16.cs index 3c6c6921c50dcf..dc9d9784c9f0fa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int16.cs @@ -76,7 +76,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int32.cs index edab91467c5502..52c13e326be9ee 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int32.cs @@ -76,7 +76,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int64.cs index f1a7680999639f..d33225f33baf67 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Int64.cs @@ -76,7 +76,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] inArray3, Int64[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.SByte.cs index 73c1d42e7aa86d..95c230394271c6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.SByte.cs @@ -76,7 +76,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] inArray3, SByte[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Single.cs index 49988bed327fd1..a06583b80e5126 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.Single.cs @@ -76,7 +76,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt16.cs index a4b704455104e9..b649828a8c5852 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt16.cs @@ -76,7 +76,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] inArray3, UInt16 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt32.cs index 3588c4644cd0ff..521721bf54324a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt32.cs @@ -76,7 +76,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] inArray3, UInt32 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt64.cs index 335dce5aa66872..65139843e51659 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConditionalSelect.UInt64.cs @@ -76,7 +76,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] inArray3, UInt64 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.Int64.cs index 7ce09c4bba89de..ffe4f5f83d5899 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.UInt64.cs index 8ae2d62323b370..880291c0005254 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt32.Single.cs index f5c9554197a567..21eb7a18abec61 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt64.Double.cs index 0a519697029bf7..6abf6f55123b61 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.Int32.cs index eed4e4f3fee13d..3daa511ca4e7fc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.UInt32.cs index c9fcdea7f90962..de0401985b24dd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToSingle.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt32.Single.cs index 09dd852366ee4e..fdc9f3005cfc3f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt64.Double.cs index e26765b741ab39..195f11d4884b16 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToUInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Byte.cs index e21ecdf863c825..ab099d5577d3d9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Double.cs index 93601ebb4e43f8..1bd2edbe753efb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int16.cs index ff6c49fa03b835..ef0d6184e4c5cb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int32.cs index afe844d0af0330..5ee42fe8daa23a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int64.cs index 3406791307563b..b03d9a0b31ccab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.SByte.cs index 3c0f97e60c6700..22ab921eece48a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Single.cs index 3c45e868368c20..8f6117a25b8190 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt16.cs index 1d5f9ddc598ea7..18ff84b7b6a5e7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt32.cs index 2856f60488e424..3ab787aaf189ff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt64.cs index 4c0681d3db25fc..817f05e1d91297 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Divide.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs index a90aa91c290d12..7b379ca30f7f18 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe { bool succeeded = true; - Byte actualResult = ComputeExpectedResult(left, right); + Byte actualResult = default; + Byte intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Byte)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe Succeeded = false; } } - - private Byte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (Byte)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (Byte)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs index c78a7e781ea748..0c181839059394 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle { bool succeeded = true; - Double actualResult = ComputeExpectedResult(left, right); + Double actualResult = default; + Double intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Double)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle Succeeded = false; } } - - private Double ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (Double)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (Double)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs index 6af78ab044679a..749c5bda7378d7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe { bool succeeded = true; - Int16 actualResult = ComputeExpectedResult(left, right); + Int16 actualResult = default; + Int16 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Int16)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe Succeeded = false; } } - - private Int16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (Int16)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (Int16)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs index 1978ad812163d3..95f0de0e628bad 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe { bool succeeded = true; - Int32 actualResult = ComputeExpectedResult(left, right); + Int32 actualResult = default; + Int32 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Int32)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe Succeeded = false; } } - - private Int32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (Int32)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (Int32)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs index 33643deeff84a2..9f8c44c0df4532 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe { bool succeeded = true; - Int64 actualResult = ComputeExpectedResult(left, right); + Int64 actualResult = default; + Int64 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Int64)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe Succeeded = false; } } - - private Int64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (Int64)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (Int64)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs index b23a0b74e01e05..5030c06dbe5b81 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe { bool succeeded = true; - SByte actualResult = ComputeExpectedResult(left, right); + SByte actualResult = default; + SByte intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (SByte)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe Succeeded = false; } } - - private SByte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (SByte)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (SByte)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs index 7c812ec7f3946c..a8ff5b209389ea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs @@ -18,6 +18,7 @@ namespace JIT.HardwareIntrinsics.General._Vector128 { public static partial class Program { + [ActiveIssue("https://github.com/dotnet/runtime/issues/75791")] [Fact] public static void DotSingle() { @@ -70,7 +71,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +294,20 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle { bool succeeded = true; - Single actualResult = ComputeExpectedResult(left, right); + Single actualResult = default; + Single intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Single)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +325,5 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle Succeeded = false; } } - - private Single ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (Single)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (Single)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs index 3af9759b78acb0..c1f73aa74a96ce 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle { bool succeeded = true; - UInt16 actualResult = ComputeExpectedResult(left, right); + UInt16 actualResult = default; + UInt16 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (UInt16)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle Succeeded = false; } } - - private UInt16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (UInt16)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (UInt16)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs index cc003b8323afb6..bf8be929170872 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle { bool succeeded = true; - UInt32 actualResult = ComputeExpectedResult(left, right); + UInt32 actualResult = default; + UInt32 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (UInt32)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle Succeeded = false; } } - - private UInt32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (UInt32)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (UInt32)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs index 8c7ba5a7e2983e..6f610e0c19f1c3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle { bool succeeded = true; - UInt64 actualResult = ComputeExpectedResult(left, right); + UInt64 actualResult = default; + UInt64 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (UInt64)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle Succeeded = false; } } - - private UInt64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (UInt64)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (UInt64)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Byte.cs index c98a4bc8cd4460..ac2bdce0c2bbcd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Double.cs index 28d51197e90593..020c5706eef30d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int16.cs index 10fe51e7741874..c0faf7c9744010 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int32.cs index 38cbe5556a1134..7020ae6484d4ea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int64.cs index 916af21d43e16b..439557a49c3bd8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.SByte.cs index 694dd545dd3dc6..83c362af070957 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Single.cs index 08cf31a72797d2..9e16406c71c71a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt16.cs index 65940866ed60a3..6e8e34831d027d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt32.cs index 1f87a9168edfe8..79bd8701647046 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt64.cs index c9a98472c261ae..d1cf2e004aa5e6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Equals.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Byte.cs index 3ca65dceca9230..1a404ca8b296dc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Double.cs index 802e80317476d7..39d260143b9663 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int16.cs index 2c1b246a1add02..1fca35f4368743 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int32.cs index ea51a5d97821a7..d737a7b3ed17ab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int64.cs index fd13d355f56c1a..af0f52e50cf5fc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.SByte.cs index 0342511a25fba2..67ae2d41c2567d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Single.cs index 2ee243bc6ca2b2..471e8c92f8f50a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt16.cs index 9491a0c2b0e408..31ae317a892eb7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt32.cs index aa00a2eaee5e1f..3281882448d8f4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt64.cs index 0ae60868d8d243..07838e36234bc8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Byte.cs index 5ac6107234a8b8..2725f0d192a387 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Double.cs index f004fee6631a92..08583a15bbed09 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int16.cs index 7cbbe6bf6452f2..6cc0be0a0e41ec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int32.cs index b0656ace5feed2..75817d0097f40b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int64.cs index d6eaf8536e8f91..fa235a129f676e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.SByte.cs index a233011a7e1064..3d938f1de4b16c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Single.cs index 87eadf29412d00..bfca3450c7d96b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt16.cs index fb0e83c1d62a4e..ffa2fbdc642bdc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt32.cs index 2677e397a3b14f..0c9ff5c03083e0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt64.cs index 96f90e0c4ce15f..4b952804f00e45 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/EqualsAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Double.cs index 12b3420550344d..bd8f3f8da9fda1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Single.cs index 92299600d442f2..ad25892c97f45c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Floor.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Byte.cs index 7c83d98f87603d..dcf196d069bbf3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Double.cs index 731574aff5d8e4..81fe64a1aa49c6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int16.cs index fdb6afaef2787a..29da672e964c1f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int32.cs index 974a06a9d184c5..f2c4df6848a481 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int64.cs index f622e26f18bfcf..7a8d2a25d2d74f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.SByte.cs index 62575e911e9894..8c3682780006f8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Single.cs index 9dcae7c568ca79..a79066950e6026 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt16.cs index 78fc8af921192e..32889b3a4d0969 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt32.cs index aa8e322c2c245d..557974928c0eb8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt64.cs index a740f55b711ad2..6051adabc0912e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Byte.cs index fc7f7d1f999256..0eb76f8113c8f3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Double.cs index 1d1b3344720a53..8b489bb594fa61 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int16.cs index 8f421e59fb4279..9f60ad63141dd5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int32.cs index c6da7d2264113d..ab01213b9aa126 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int64.cs index b86c6026e3e148..3df99374385e47 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.SByte.cs index 8f0a8fa47b733d..7dd41c6e750c29 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Single.cs index 7fd977c98b0742..e74825c96117a5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt16.cs index 6247b7ffcc7299..c4e181f431e656 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt32.cs index 73f769e8502f23..b7f43c8b7f237f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt64.cs index 34576fe974143b..c64809ff17aea7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Byte.cs index 0591d59afb9710..a8faae908f3676 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Double.cs index 881b0708668bf0..adf0ec9de3de08 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int16.cs index 04ee0e9dd9d8fe..6c437b1fbce1d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int32.cs index d178886a7827d2..fab1b9b9af6c2b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int64.cs index a1a55718b5a997..4632c18a421227 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.SByte.cs index b43b4d6a5beec6..c6d6636cbaa83b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Single.cs index 443c9f9b28e905..49ee78917452e6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt16.cs index b3515fb0713b1d..fafa5c1d488313 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt32.cs index cc329414feb092..413e515705ea85 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt64.cs index 638c718092f7eb..257f8af1978c95 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Byte.cs index 31bf7a269d2827..1a344fc7db1dd1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Double.cs index 7bcd2dc9435712..b12f722d460298 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int16.cs index c9ab257e4d4a32..d85de4b05ba6bf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int32.cs index 1187105ec5b6bc..09c6597a2768b7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int64.cs index 363cf6df06a468..340ad93eda8efb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.SByte.cs index d0a414f7eecec7..ea250dcded4125 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Single.cs index f5334055a8326d..df47ca084b0aca 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt16.cs index 9bb090e490385d..a4e84c10d9c677 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt32.cs index fcdc86bd143b44..4ec9c5cf5fb141 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt64.cs index b4a3ff141f7076..6d7a30275b2edc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Byte.cs index a339139b7513bb..9d09d3b2e0e069 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Double.cs index 5dc01c96712924..19ff3bc8be4116 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int16.cs index c0d70159749978..e7ef49e817374a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int32.cs index 6b55b81f5046cf..9724d5c1c7a405 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int64.cs index 38d2e1bd3218b8..a9650dad879d04 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.SByte.cs index de778a8701683c..1fdefcdf76b2df 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Single.cs index 9f33d60ac130e1..213a9fb3592d4c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt16.cs index c3f3e951bb39b3..26561cca715dfa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt32.cs index 407b1fe98b8417..3c7b266b379401 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt64.cs index ee7b4598f00e8e..d597dc99b8747a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Byte.cs index 414033ba1a84f5..14d3b36ee82c4c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Double.cs index 1805578d6f695c..a12b7151a9180f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int16.cs index 523222169cb045..c82c22c7922751 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int32.cs index cd2f81d668fad8..e7cd56d0b26894 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int64.cs index 6759ad1abb2364..ca8e93243d1a95 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.SByte.cs index fc783426a674af..d45e324cd0132f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Single.cs index 6f30ef4805a075..477d1e47b7e485 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt16.cs index b07e85aa917e8a..6745c32d8dc4dc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt32.cs index a92ff62fce4d33..67dcc6084a2f96 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt64.cs index 08da64978cac7a..bc1ea61745dd75 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/GreaterThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Byte.cs index 009fa5340a10fd..0aed93ce1d9f3e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Double.cs index 30b683466899a1..08311ec95f66f9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int16.cs index 8db4df9e773827..2f7446c73dff9f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int32.cs index a2bb121b0911f7..5bfc55c9f7aa5f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int64.cs index 4e59289f3599ff..dec4ba4e1e30e5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.SByte.cs index e4d9010a28ed95..d41955104e120c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Single.cs index d75e3a6f1d11dd..9afc0304debd5a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt16.cs index 197077ecba7039..adfb6cb83fe14e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt32.cs index 03588351fe3d6f..1acadc53477643 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt64.cs index 00da3a586551ba..c18f9dc8472179 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Byte.cs index 4a3d08afd78d4f..e93551b508bee8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Double.cs index 7d9130b25e2d11..56890bfd8f56c4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int16.cs index dfd9df4e3be441..7f7fab89019e81 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int32.cs index 75dcc5888dc40f..5669191dc0468f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int64.cs index c099f49119493e..0c9c59d659c770 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.SByte.cs index f1990ec127e5de..2ab812a70e0939 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Single.cs index 97c904e856279e..25de175ca3b0d0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt16.cs index 4a996817cf1681..482a8d0cf57c63 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt32.cs index 6341ddf48d2336..c8f6b8b845be2a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt64.cs index 5413be4d033d2e..80afcc46740da7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Byte.cs index 5dc722df128f1d..6e550b543871bb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Double.cs index f90fa9346ef11b..793207e8b1b620 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int16.cs index 23a0b4a5899040..5d8f4e57c65256 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int32.cs index 282d8b7c03e50c..c8d61271fb3353 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int64.cs index bb6b0ac75e565b..a204e128d640da 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.SByte.cs index 474681b5e2d2b9..9c623378adfe44 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Single.cs index b406dbcafa0162..387363272c86b7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt16.cs index 167661fe0c14e8..d13f30b60aeb36 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt32.cs index cdcc426e38b7f0..0cb59c88e73280 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt64.cs index b34c060ad3c4f6..c42aa490cac6e0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Byte.cs index 6f492f5a3d3595..207acd3aae543e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Double.cs index 359d8384c1e27b..98170bb743bb64 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int16.cs index a8e847a23680cb..72f1317b186232 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int32.cs index 19e66e6ba9f846..f82ce0c9f6862c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int64.cs index d0c65c9a35c499..00965568023274 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.SByte.cs index b654f65a8fec3f..6db62ae3fae703 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Single.cs index 7618dff86f11cd..f9a5168c59f86a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt16.cs index 02204a4d6c4505..9f015d71694cec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt32.cs index 89e79f69f7e3d0..3a3b068f7a341b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt64.cs index 80e90e796608c7..f5294c3e06c6e4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Byte.cs index 0a667fa430a932..ee03e315066660 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Double.cs index a4f3492c2d6990..1b185d8135a96e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int16.cs index 8334209a242eec..7e0d0f98b6c9d9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int32.cs index 8b7b5a78e45851..21ac788303decb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int64.cs index 30c54259c769ba..f868bf6eece6a9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.SByte.cs index bd187f62e4596b..7a7bed6d14b2e1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Single.cs index 1ef7dabccd5404..ea20ead9dba91e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt16.cs index 53a6ec4e0119ee..6a8a90a0824c0d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt32.cs index 638735e9712251..50f8b9a81e08fd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt64.cs index 0c386ef47dc1b2..11d1dd2dabb632 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Byte.cs index e214058707d09e..21a42ee4433bbf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Double.cs index 7be9e4b4e311ff..1223b42d0b3fec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int16.cs index b89d325ddd63e7..da9cfcb741e949 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int32.cs index 24c6cae916d42c..d0709226e90f0d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int64.cs index 245dcba0eddd8a..9041636eaba808 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.SByte.cs index 328085dc4fa4d8..c0d4df2747bc32 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Single.cs index fbfaf06b8e42c3..9c5cb438f073e7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt16.cs index eb5c55471f5c98..59c0ee12acf253 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt32.cs index 0c7c5474dc6eca..309ea2f4f46612 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt64.cs index 9fb7ea5b9e9143..c47b7d71ef5289 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/LessThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Byte.cs index 3313ec6f6da3f4..96f17ff33df891 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Double.cs index 9217ab90109156..931b02e1c9d21a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int16.cs index 504c200f9230b7..9800b8a4029d56 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int32.cs index 4201ce2d615e1c..d1b52eb2f728ae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int64.cs index 492f30582c4fe4..4bcf27d2a27beb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.SByte.cs index ceafc180edccaf..36fcab72c2b38c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Single.cs index ed774dd9725475..9b3583b8851d50 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt16.cs index 88db6f731b4968..ac7f9329523ffb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt32.cs index 2eb09ef255e351..0f00fff59d4a64 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt64.cs index 18f4a554c412b2..cc197a68ecfff8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Byte.cs index be5743fb8c1391..be9a7453c6c8e0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Double.cs index a461545d050ecf..d25f88cdc8260a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int16.cs index 58cbb795f6f6d9..ef0b4d8c94abc6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int32.cs index 71798ef1a11b4e..36eccb443d9db3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int64.cs index 252e530907153a..cc1cd68577805a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.SByte.cs index fcf51be9c12fef..53662266943b87 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Single.cs index 730e2254cc1224..f3bf7c44a8b3c7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt16.cs index 32d9b393f7d954..301fb1471474fd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt32.cs index 50fc1a1cd64884..723bfd045f1537 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt64.cs index 51544103c50bed..075e40b3558741 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Min.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Byte.cs index 61b03627a4d84d..30fc0dec042fb3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Double.cs index 6cc2afe4045e81..cd721115b58556 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int16.cs index 6734a0793c412e..1982806e2e5963 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int32.cs index 64cd0f0a1b6520..d87372957542d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int64.cs index 39afc884ec2030..48417e5ab6e00a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.SByte.cs index 086f1848a94906..883157b69966bc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Single.cs index 7074c186a3dfcc..764cb5fbf46950 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt16.cs index 86956da2adef1d..77c4f8a636ff18 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt32.cs index bbdb4b6f6835d5..c4e5f639ca2311 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt64.cs index 03c04de59d91d7..0a91453b868bc3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Double.cs index 3506ab36b640db..316a4bffbfeef5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int16.cs index 21c5e24cfefbbe..7ffcaebe7fde19 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int32.cs index 002d6a86701572..7b31df9d40f247 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int64.cs index 8d58e1ca29f5e9..92c031e380f0dc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt16.cs index bdcdf9f6f6d884..ce5a332667bcb4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, Byte[] outArray, int alig int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt32.cs index c18951ff6d4a23..1ca2b8c5dbaf72 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt64.cs index 723df02c84a61d..6767c399898dce 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Narrow.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Byte.cs index 01cac29f4eeffa..25d9d9406267cb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Double.cs index 8d23fa65c16a59..a5674091f640ad 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int16.cs index 5b74b4743ecad8..e7e098faa15073 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int32.cs index ba24bcc97ae0d8..79512cc63bd64a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int64.cs index 6c63447bc0a1dc..034faa0857623d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.SByte.cs index 12d11ce352b43c..814fdb7cf2beac 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Single.cs index 16ed7c1b476fea..9d54008ae1366d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt16.cs index 6ad85a2b12f48f..90404bebcda23c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt32.cs index 0575e7a921645b..bef31c013cb71f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt64.cs index d5b5bd6301bd46..3ed9fc42091e64 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Negate.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Byte.cs index a024b14482bfb8..10849f9bc074e9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Double.cs index 4b883e2454f8b9..8c4391aa7dfa72 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int16.cs index 29466f54a936e6..783e528f21c78a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int32.cs index 36c88e664b502f..79ee53400150e0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int64.cs index d8f90a7aa01f9f..f4dbc8fa6a00df 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.SByte.cs index 5a6af134b88318..fb6f18ba574ba7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Single.cs index 3dafd6ef34d304..06aa8b81549c8e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt16.cs index 4cf7b1dbf73e02..1869b927447bfd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt32.cs index 81a282e6889720..76b2b650cdf13f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt64.cs index ee271905626f1c..3d8ca36c5ba4f6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Byte.cs index 74c2b20756a8fc..23fe4592b3b7d4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Double.cs index aa344f305720db..598cf517ed9cdd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int16.cs index b7057bd8e97f6e..9493123ea13346 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int32.cs index dce4214679a7c6..145a23d5656434 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int64.cs index 3581fcc3b63cfb..87df1ea923c978 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.SByte.cs index 76f1e55dec0fb5..0d684b2bb98154 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Single.cs index f01544d71bd628..3ec8b90aea139b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt16.cs index 2f171f9f1b3d31..f4fa9dd74ace2a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt32.cs index 493948ae8a7696..55aacd58d3844a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt64.cs index b19826480ef2ea..61f3c627e5c6ef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Sqrt.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Byte.cs index b694039349d514..07742b8edac3ef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Double.cs index d9045d03aac05f..0e0beaeec4ea74 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int16.cs index 2eb7bbc1bae5e3..62e55e714e7e18 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int32.cs index a9e40a6630bbb4..a9462a00cb7d16 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int64.cs index 60880df9cdd204..d1b8401b3fbe71 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.SByte.cs index a03123647884f2..12e064ee1db653 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Single.cs index a07a55e6c29bae..eabbe1f13d30aa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt16.cs index 94f31182e81328..f6263b5a75b74f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt32.cs index c7a6e05ed9dc9c..04472582afad88 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt64.cs index 7addb0d4a9b837..8ddbbdc7babaa8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Subtract.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Double.cs index 6464e160f458bb..d865ea93622dd9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Double.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Double[] outLowerArray, Double[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int16.cs index ee76f49c87927e..dd0f11abd8a026 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int16.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, Int16[] outLowerArray, Int16[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int32.cs index 55c765848bf77a..fe24461e0ee256 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int32[] outLowerArray, Int32[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int64.cs index ae53e4c4f4cbac..396b831e83b6aa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int64[] outLowerArray, Int64[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt16.cs index 9abf0a3d24897e..c6da633cb396a0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, UInt16[] outLowerArray, UInt16[] outUpperArray int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt32.cs index c32799759a76c9..bf946ba93a858e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt32[] outLowerArray, UInt32[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt64.cs index a6ab95b6e9c176..08f751532ad921 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Widen.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt64[] outLowerArray, UInt64[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Byte.cs index d55af3ec5af6c3..cd7736a90c83e7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Double.cs index 50c0d0858e4841..91227dcfe950bb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int16.cs index 3331da7108b8c6..e16f27f2435090 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int32.cs index 86195a6fdeca8a..c1dbce0930fb20 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int64.cs index 0375b57067bf90..f26579d9372ae2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.SByte.cs index 9926e428d59b29..7ca5b7e2fb9d36 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Single.cs index 67358377463015..87691e6619d2be 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt16.cs index b86eb0f2a7de89..0da277232aca72 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt32.cs index b76d24466ef367..ac0fa9425222ad 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt64.cs index b71007b0c28353..5a5abf82556ce4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Xor.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/Program.Vector128_1.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/Program.Vector128_1.cs index e19a918ef55b60..5bd034ce1e0be5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/Program.Vector128_1.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/Program.Vector128_1.cs @@ -3,6 +3,9 @@ using System; using System.Collections.Generic; +using Xunit; + +[assembly:ActiveIssue("https://github.com/dotnet/runtime/issues/54122", TestPlatforms.Browser)] namespace JIT.HardwareIntrinsics.General._Vector128_1 { diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Byte.cs index f42b1b5c0e798c..f63161cd05f3d0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Double.cs index 0f0895e2f42afc..2e703e27eb194d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int16.cs index b3d9cbc22ba712..b68bee5d3ac0c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int32.cs index 2e367342c85772..4bbd162192e7dc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int64.cs index 1b6cec1b58bf1f..eb48c56166eb1a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.SByte.cs index 1b2fdbc3647c1f..45967f3c3a8a54 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Single.cs index 1330317adc50ea..f47dc8f4e0ca13 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt16.cs index ac286b15013b9d..108916ce746ca2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt32.cs index da113189de5388..1cc72f3b976b57 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt64.cs index 88360377ded9c2..32d4ca0d814ccc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Addition.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Byte.cs index 0e0475db080602..e23f664e76c63b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Double.cs index 3352e894a0bc2b..aa04105b7e88ba 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int16.cs index e357116963a3dc..565e173d1444e5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int32.cs index 5097d936fc5fd9..42ce5c4100aaf2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int64.cs index 91ebd92665d19e..23252d10fb7b96 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.SByte.cs index af196f1ab8f323..75127a38860658 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Single.cs index f8e4023ac820bc..fd7bed3d62f8fb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt16.cs index c5f8ec4dbc1ccf..b804a82bbdd262 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt32.cs index 1a6c9e16143470..a388838307bebc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt64.cs index 1c63acf4cd1f1e..000ce40831f3ca 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Byte.cs index ab34d00a98f697..95602aec1b7ced 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Double.cs index 703ebdf84923dc..13437ed7957f97 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int16.cs index 756a1ed56e4b34..ed4cd116ba30e0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int32.cs index c835d85433eee7..a4f048b79a4fc8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int64.cs index 1088ba50f98f7d..5a46a78c59fa6b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.SByte.cs index 08ea29a733b64b..e17a8376a8b9a0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Single.cs index 2e2e50a2522580..09d833b157623c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt16.cs index 15d426eac7dea8..905eaaaad96265 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt32.cs index b80c3a76727e8c..31ea3b66dcc21d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt64.cs index eeb912f98ed886..2a74ce7e2bc842 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Byte.cs index 4eb8b516eb8503..c0f89a054c972e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Double.cs index dc0abc1ef4c44e..a0fab334226977 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int16.cs index 651ae97f8d80f8..15fb641652637d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int32.cs index 891a2c4d9fc1d7..1bb172b9affcc3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int64.cs index 3243b61f6986c2..0581ed5e82cc00 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.SByte.cs index b5cf029f7a6707..a6014ed9f875f9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Single.cs index 7959dbaaba99ae..608dc6b7b7ea63 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt16.cs index f1edbb05c8492e..ab1feaebdace73 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt32.cs index 916749722544b4..60aa7fa5b40375 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt64.cs index b0406de7008831..9d03ffc3e4df96 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Division.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Byte.cs index 236d370bc6ced8..3c979dee80448f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Double.cs index 4a9ac8c5a54270..c02b52b9c71afb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int16.cs index 9fc8f316b94f1f..b0a48606cdca46 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int32.cs index 9522aa94877f38..e5263a8f6af562 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int64.cs index 43a49d2553ea74..6e448381f9fdf1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.SByte.cs index 4f72a284cf15a2..17a4e91a075806 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Single.cs index c108ef12950f46..b2fdf83ea35d60 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt16.cs index c0697cd97338f3..ab40b64701b9d6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt32.cs index eceadd5b734a73..a63bd05722cf50 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt64.cs index 61bf95a0b5cdef..8c36fe758abce5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Equality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Byte.cs index 6e27bd4adde6e9..aa28b5af2e5c5a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Double.cs index 77a2b22ec30ad9..024c9604576498 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int16.cs index e01b978fcc06a7..358dd26fe55d15 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int32.cs index d75845c291fbb3..b96e6e18880935 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int64.cs index 06e546bf666410..f481e4f0f78f86 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.SByte.cs index f12c3ee40d3ace..0cdf7ef8693862 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Single.cs index 747a675a7d1d25..8a7f0f43806ba2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt16.cs index 370ed656f7318c..d57e02178caab5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt32.cs index 2b5c4278e36689..1f547fb3d1bfaf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt64.cs index 4cabfe5728c912..e0d5f5d1753883 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_ExclusiveOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Byte.cs index 059ddc54ab1f15..3a90d4c05c5a0c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Double.cs index 462861ed829bac..96456d284434c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int16.cs index 89192cdd81b8d3..9b239c81b56911 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int32.cs index afb21231d46e02..26968c666b1aa5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int64.cs index 4201bfde35f9af..2e1fc4f9a5696f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.SByte.cs index ee8c2f0336d6ea..9bea81c6289cf2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Single.cs index 4c86893a72275d..a6b47cb988c93e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt16.cs index 9a566881be8d2e..63ece0ce9cea5f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt32.cs index 05699744ee453d..96eeb23a1f7532 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt64.cs index b4d98a64cd6836..0bca1655946d10 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Inequality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Byte.cs index d55cebc34d151e..7b85c9a93d1927 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Double.cs index b48f6e77558dda..792d48e87014e8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int16.cs index 2074950cfd9ed3..5b457c86b87f9d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int32.cs index c0d1cdbfb0efb1..53ea73a37bea15 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int64.cs index 38d5c71e6c22db..3fbc0df9983ab7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.SByte.cs index a36b34a0fce2d6..6a5bc62b321d96 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Single.cs index e5e97e57f6cb29..1594a9c2f6ac4f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt16.cs index 8e5cdc6898879d..68df3fca50f206 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt32.cs index 7f85d68c1d070f..755fb0e365b598 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt64.cs index c7580d0dacd5db..0a77706e24cae0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Byte.cs index cca8d46df429d7..c4e3794f550edf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Double.cs index 98905e9b29b04b..a48e056092a285 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int16.cs index 5426194ef1311e..583b27b22aabf2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int32.cs index f03bad7f57ae94..f5c9c1cb60dd45 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int64.cs index 4e9b4392bb220b..6dd578a9e030e2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.SByte.cs index 334bf4825abf32..445d30407bb320 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Single.cs index 7f63e504b2ac64..36050d973cb233 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt16.cs index cd9237efd26e66..5219f2f28da810 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt32.cs index 55ae21a14646e7..5c446034e345cd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt64.cs index 4c49781895df23..d3de409e6163d8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Byte.cs index 25b58f9102fe4b..9aabc2665b684a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Double.cs index c37e36df9c1920..973e006a2da043 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int16.cs index 6de64be1232046..23c0d54d5c87a0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int32.cs index 0d665aafdf8caf..3a070a071eacd9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int64.cs index 108c0db4adbdbe..5fe8b862f88ba5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.SByte.cs index 2b48650906b42e..cf72f0846dc331 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Single.cs index 7d2a51f06c9d30..a6ffca6b3e6239 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt16.cs index 8a42b982dc676a..8c0d07958a95f4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt32.cs index 13b71db2acf7e3..a02012ceb89762 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt64.cs index a46bed0d790c7f..906608d24b34c3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_Subtraction.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Byte.cs index 982a6ff8308bcc..c84ec223921800 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Double.cs index 8cb755a2a1bb18..4191d69f96a23e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int16.cs index 9c67bdc2075250..9fabcfd66019da 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int32.cs index b32d0f3d63f33c..b9139a5198b262 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int64.cs index 3e46eacc9081fb..430ab83c3d072c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.SByte.cs index 9997fa4cbdfc93..1cc965eb413508 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Single.cs index 0db5f27b522bd5..69dc57861a41d9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt16.cs index daea9002c054b7..2d111b9dbdd5bd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt32.cs index 113f001c0e881f..61a56f6d1e3a53 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt64.cs index 0ff4f547796a18..507c691b020b7e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryNegation.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Byte.cs index 2720e9958a7671..5b4585b850af36 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Double.cs index b6e4efcc880df3..32bac9b13a8f8e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int16.cs index f67ab27845ce14..fa2ac64cb64002 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int32.cs index f61f63a33bafab..aa305771ca3e92 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int64.cs index bb45e26781661e..d077efbbd7e84d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.SByte.cs index 1313b67ad9ce2f..7ada5957b89865 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Single.cs index 92399afabf3404..013919f58716f7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt16.cs index 2dd67c0444e4b4..e0527277fb52bf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt32.cs index 3f541fd1d6f6cc..2ec153cba7d901 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt64.cs index 46fe0dd0d41f85..33b190bd5836d0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128_1/op_UnaryPlus.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Byte.cs index e3904df4c9d758..6f6048cfc5110c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Double.cs index 929957fe8a33a2..304f294f8f9e23 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int16.cs index fa622244ef6de8..4f733a39a359f3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int32.cs index 0a9c30f56fbf40..aa092e4f470f57 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int64.cs index 570111e8d5b2ee..9534fc747811f2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.SByte.cs index 2489f279e6222c..3a68fa3e7147f4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Single.cs index b5c15536333fbc..98e812cb1f3f75 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt16.cs index f25f1d26126539..58c7505e3ae3ed 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt32.cs index 0e59d113615fdd..113f57a3b00e50 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt64.cs index e5bf17c5e9c170..70331b0565935e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Abs.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Byte.cs index 9113af55e5faff..3bd231118ebf2e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Double.cs index 53457a93b502cb..8e4df3ce537f12 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int16.cs index 8a597c2bf9752d..57fdad1a4cb491 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int32.cs index 2dc8105149f068..3091594a98dbe8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int64.cs index a7112c7b510a7d..04f95e17990700 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.SByte.cs index 5c8409f6790810..be3bdd63da2295 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Single.cs index 6ecdb6f12df4fe..75c7721d104714 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt16.cs index 636824c1a78569..e282cbc615c377 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt32.cs index 7eadfb90c3f29b..7cbd2f0cffc136 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt64.cs index 15020035c56d86..4075261ce2a65d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Add.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Byte.cs index 7aa391cf2d9041..2b641fb23c8eb2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Double.cs index 74525b2385d4cf..10b298a0f30dfc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int16.cs index 1d45cfef2fc7ef..28ff24affa8eef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int32.cs index 5e364f77d62d43..bfbb4697fa71c7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int64.cs index 68e5074d781429..d411a1c28c8262 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.SByte.cs index 1bae7ea950d548..a83285473098a0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Single.cs index b0a6731ab08bb7..b812f863053672 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt16.cs index cbe154b5c24a0c..78b911bce68ef5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt32.cs index f3b247120895bf..715deb7287b4de 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt64.cs index df1988fc9461d9..57268ae8950309 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/AndNot.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Byte.cs index 4d73d591e67ce4..6e176d5724675a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Double.cs index 45a28416982352..eb19e94ab75aa9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int16.cs index 009f0b2f9cc3c2..7e9252d83ff431 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int32.cs index 774608bcbb677e..c692ae723a0f59 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int64.cs index bcc3acbcbce5ef..52cc435853f96c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.SByte.cs index 96710c28a23b6d..77160c3bd4787b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Single.cs index 306b188c81846f..c158f6fc9c272f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt16.cs index e16b1d59c8262e..97728f07ca42e3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt32.cs index 408749a97b0194..6bd89d470dc605 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt64.cs index 673f84386daf09..ac587ff9d95ca0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Byte.cs index 39bfaa87ffa59f..798e6c1fba4907 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Double.cs index 6f5dd49803c210..01976cbb040880 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int16.cs index 5a0a36e05e371d..f59b2e82f558c6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int32.cs index df62d304e46ad7..48712c1658bc10 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int64.cs index c51774420ca02c..69aa05b128ce09 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.SByte.cs index f0c8fdf667b1bd..3ec930751359fa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Single.cs index b3ee3acba7ff24..db508a8a1e0f0d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt16.cs index 2f6d484dfef3df..3d9e4e22892793 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt32.cs index 8c0c867452ffb9..ab420ddb9fcf3f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt64.cs index 19179a860f9537..84a20bb45e8676 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Double.cs index 0836a8b75ceb10..c24e98423cd34f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Single.cs index 35a178122728b9..12f42a3da3d59c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Ceiling.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Byte.cs index 2ef4c02c359299..68b072c8224859 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Byte.cs @@ -76,7 +76,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] inArray3, Byte[] outAr int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Double.cs index 57d8647eadebc4..b1dc65e26948c8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Double.cs @@ -76,7 +76,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] inArray3, Double int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int16.cs index 843da6dfebecb8..289a6384e20532 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int16.cs @@ -76,7 +76,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int32.cs index 58008ecc0a9484..ccfbe77b40032d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int32.cs @@ -76,7 +76,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int64.cs index d7c48534bb1758..e0bc1b0b43fcc1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Int64.cs @@ -76,7 +76,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] inArray3, Int64[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.SByte.cs index e75a177bf78c85..94082526409f7e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.SByte.cs @@ -76,7 +76,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] inArray3, SByte[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Single.cs index 33c7e9a3226982..38a0b3549edbea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.Single.cs @@ -76,7 +76,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt16.cs index 60e8f6bc990d18..0f93ac17a41332 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt16.cs @@ -76,7 +76,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] inArray3, UInt16 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt32.cs index a869f0d60dd5a9..466447c2814d89 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt32.cs @@ -76,7 +76,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] inArray3, UInt32 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt64.cs index e18f43fd35f53a..24e29310a7ed94 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConditionalSelect.UInt64.cs @@ -76,7 +76,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] inArray3, UInt64 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.Int64.cs index 00152fcc325751..8b8235774162a2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } @@ -287,6 +287,7 @@ private void ValidateResult(Int64[] firstOp, Double[] result, [CallerMemberName] if (result[0] != (double)(firstOp[0])) { + Environment.FailFast("Temporary instrumentation to diagnose https://github.com/dotnet/runtime/issues/76280"); succeeded = false; } else @@ -295,6 +296,7 @@ private void ValidateResult(Int64[] firstOp, Double[] result, [CallerMemberName] { if (result[i] != (double)(firstOp[i])) { + Environment.FailFast("Temporary instrumentation to diagnose https://github.com/dotnet/runtime/issues/76280"); succeeded = false; break; } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.UInt64.cs index 2aa93b25f76d01..dde1d66100bc4d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToDouble.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } @@ -287,6 +287,7 @@ private void ValidateResult(UInt64[] firstOp, Double[] result, [CallerMemberName if (result[0] != (double)(firstOp[0])) { + Environment.FailFast("Temporary instrumentation to diagnose https://github.com/dotnet/runtime/issues/76280"); succeeded = false; } else @@ -295,6 +296,7 @@ private void ValidateResult(UInt64[] firstOp, Double[] result, [CallerMemberName { if (result[i] != (double)(firstOp[i])) { + Environment.FailFast("Temporary instrumentation to diagnose https://github.com/dotnet/runtime/issues/76280"); succeeded = false; break; } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt32.Single.cs index 21f057fe447cc9..90bdc193cbfd85 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt64.Double.cs index 54305f6bbb008b..0df58f23e83d05 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.Int32.cs index 008422d75bbaa5..a68d39e63f8775 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.UInt32.cs index 549998c8e64ea5..52abe0e6392289 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToSingle.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt32.Single.cs index 37ece50d0226d2..5e8db4b5a576ea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt64.Double.cs index 2a07c0f40ca4ca..3717465880481e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/ConvertToUInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Byte.cs index ce90736b848455..958de9cb1a9b02 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Double.cs index b3fd9df878fc39..8be4651e75a7aa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int16.cs index e77672e7100177..ceb0d0a57f2364 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int32.cs index bfe31c58e154d7..901b5a4875551c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int64.cs index 2324a34192d5ce..a02c33b317578b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.SByte.cs index d75ae6d4e02e89..908849f5f5cfb2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Single.cs index 2f61a1cacb3d6c..f45f7fe3119956 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt16.cs index 646b740c92656e..d88c20170d8740 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt32.cs index 979b1f1451e46f..a46b97ef51e4ae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt64.cs index a7197b3aadb7ca..dcf4c518be91be 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Divide.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs index 048f964f45e177..d4e57461c765cc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe { bool succeeded = true; - Byte actualResult = ComputeExpectedResult(left, right); + Byte actualResult = default; + Byte intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Byte)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe Succeeded = false; } } - - private Byte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (Byte)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (Byte)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs index 76f31b0ddd9087..e6eb7a4c473aba 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle { bool succeeded = true; - Double actualResult = ComputeExpectedResult(left, right); + Double actualResult = default; + Double intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Double)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle Succeeded = false; } } - - private Double ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (Double)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (Double)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs index ca2c92720a76a6..226cffc5d4d817 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe { bool succeeded = true; - Int16 actualResult = ComputeExpectedResult(left, right); + Int16 actualResult = default; + Int16 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Int16)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe Succeeded = false; } } - - private Int16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (Int16)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (Int16)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs index 1d29cb0741e8f2..0add06a6628061 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe { bool succeeded = true; - Int32 actualResult = ComputeExpectedResult(left, right); + Int32 actualResult = default; + Int32 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Int32)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe Succeeded = false; } } - - private Int32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (Int32)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (Int32)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs index a13094419838d0..91faf9fe2b431e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe { bool succeeded = true; - Int64 actualResult = ComputeExpectedResult(left, right); + Int64 actualResult = default; + Int64 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Int64)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe Succeeded = false; } } - - private Int64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (Int64)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (Int64)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs index 57b5732ff478a4..bc4db8729d73f3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe { bool succeeded = true; - SByte actualResult = ComputeExpectedResult(left, right); + SByte actualResult = default; + SByte intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (SByte)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe Succeeded = false; } } - - private SByte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (SByte)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (SByte)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs index f6809a4ab2b073..eb9cf19f744f0a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs @@ -18,6 +18,7 @@ namespace JIT.HardwareIntrinsics.General._Vector256 { public static partial class Program { + [ActiveIssue("https://github.com/dotnet/runtime/issues/75791")] [Fact] public static void DotSingle() { @@ -70,7 +71,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +294,20 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle { bool succeeded = true; - Single actualResult = ComputeExpectedResult(left, right); + Single actualResult = default; + Single intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Single)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +325,5 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle Succeeded = false; } } - - private Single ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (Single)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (Single)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs index ebbd03623ff53f..8779fca1d0b8c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle { bool succeeded = true; - UInt16 actualResult = ComputeExpectedResult(left, right); + UInt16 actualResult = default; + UInt16 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (UInt16)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle Succeeded = false; } } - - private UInt16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (UInt16)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (UInt16)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs index 115218d79fa27d..09a769c9916c01 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle { bool succeeded = true; - UInt32 actualResult = ComputeExpectedResult(left, right); + UInt32 actualResult = default; + UInt32 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (UInt32)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle Succeeded = false; } } - - private UInt32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (UInt32)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (UInt32)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs index 61f8ceac1a4a59..26f8806b0b575b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle { bool succeeded = true; - UInt64 actualResult = ComputeExpectedResult(left, right); + UInt64 actualResult = default; + UInt64 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (UInt64)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle Succeeded = false; } } - - private UInt64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (UInt64)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (UInt64)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Byte.cs index e1233beb988b9c..8146aac8fe5145 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Double.cs index 26fa093fc65832..342000263295ed 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int16.cs index 3ec546f6974d3d..38b9f65e07c1b1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int32.cs index 0e316894b72b8f..c34a148e458401 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int64.cs index 3af6c40aa2e91a..91379253e748d4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.SByte.cs index 452c934572f330..ffd19057c3f0bf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Single.cs index eb54447236f2f5..3a10728513638a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt16.cs index b6dd8330f18570..8f28fa0fee704e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt32.cs index 93910d4b55da68..81d759e8cf3c73 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt64.cs index dc0f9b4ecfafb5..1137e47680e426 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Equals.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Byte.cs index aa68df642e2e54..1ea6cdcdeb9a9b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Double.cs index 2a09e8ad9f4481..e3dc529ed759e7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int16.cs index c19a3cbc631742..2f610115ce9af9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int32.cs index 1b5089621ba0d0..ed14aa0007c8fe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int64.cs index e098f1b2ccb00d..c23c4197da73b8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.SByte.cs index f11beffd5d35f2..7ce5d221be58a2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Single.cs index c3e806e7a1ea28..becbe63312a047 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt16.cs index 6fc9ba1c740c6f..26f9c5de1837ec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt32.cs index c0b8653046a82f..bce67fd3508451 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt64.cs index 07747c9e98285d..409dc3e300bfad 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Byte.cs index 75a676566e0dec..c43334bd68456d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Double.cs index 83ff9fdc4019a8..b193396a71e52d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int16.cs index 2bc69e19f68d4f..81aa451cd66e95 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int32.cs index 9e9a694530ac2e..aa3fe9f788b00c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int64.cs index e7ed20ebab1a3e..429a5951137122 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.SByte.cs index aaf4c73ef1c7c2..3d0146af14469b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Single.cs index 064da653d3e5ca..da46cb195e1701 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt16.cs index 57463066db716d..3d8d83f10d5330 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt32.cs index fad29292ba8c89..ebc149e18b8ef8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt64.cs index bfa99cec7aed86..6aedf31f0de887 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/EqualsAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Double.cs index 9ad9a2e981ea12..e6a8f0285a481c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Single.cs index 591aa0ed14f009..f611a9b1af7f09 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Floor.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Byte.cs index 8a92f728a71e54..d667e1e039c661 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Double.cs index 9e8af671c54c44..db0647bb266616 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int16.cs index 924621c250c85e..315a41c1957fc8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int32.cs index e003e6da23ad52..47d5de0f93ff26 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int64.cs index 60c7158eef97c7..0b9886af4e7a5b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.SByte.cs index 76f56aff2c0ef0..79a3261d939668 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Single.cs index 4ef5c335b4dd83..8a9b208af69eed 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt16.cs index f259cf7cba9f9d..e93cf2a4f6da40 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt32.cs index 78fb7464bfe2f4..58894a57ed5fde 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt64.cs index 32640f80bcc602..a5643a2ac88d18 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Byte.cs index aef11e782c2123..9af58b9dcc5e61 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Double.cs index baa137a9728424..3b4c3012dc0d40 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int16.cs index 19b78c105f7615..d511dc208275b4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int32.cs index 6b9e6d29ce1cd9..9b99a2a450256f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int64.cs index 3e77806dab948d..f497c437276410 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.SByte.cs index 3b86b90b3db4eb..86066da95e574e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Single.cs index 7674c33087335c..b91838218e001c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt16.cs index dfd8121a23a5d4..00bdc5e60048c7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt32.cs index 6e161ba7de0b49..b1a92419d062df 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt64.cs index dfdc70a9e405f7..713a175070d876 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Byte.cs index 955b77ea30e08c..6cc131927cfbe3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Double.cs index ecc3405a680683..a2f41a177adf24 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int16.cs index ba7473149c356a..ff4f20137ea0fd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int32.cs index f8200d80755769..39b64044f21836 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int64.cs index 4ae138a01a5f2b..5b467395ceb672 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.SByte.cs index 288daaf8eedaae..baca1af9585646 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Single.cs index 0b94e946d9b52b..9652714a6f0a45 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt16.cs index b68d18ed3777a1..3958185b974fb5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt32.cs index 950a3d329a9dd9..46b7a402a44b43 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt64.cs index ffb4c9c4764005..f7374e5487181a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Byte.cs index aad61250debf70..ce1ae37d28a911 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Double.cs index 6175d28e2f1441..970dbb32592ef4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int16.cs index 7eca4e3822c5fc..4119f755f02ee3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int32.cs index f1d13900237b72..6cfdcc4cced765 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int64.cs index 122693d237a1d6..91b2c3df970c25 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.SByte.cs index 00e25fd1150679..be489f228db1b2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Single.cs index 87f2b429576aab..8e400d153ca1f2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt16.cs index 357abdca0ec802..d02d88ae94434e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt32.cs index 8291245df29b41..ff6e04abcc981e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt64.cs index 362e6fe2cc535e..62ef62117112cf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Byte.cs index fa6909e899c505..b0662902e675e3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Double.cs index 26042c59238ea1..7d29923a1c4890 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int16.cs index c7ce02d82f5a44..d430b3b1143af0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int32.cs index 32f05046822144..b1d5a6fb4d56cc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int64.cs index c09b393c377cb8..0c6c3d319088d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.SByte.cs index 5207edce4ef5de..e8658ada9bf7b8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Single.cs index bff1bdcbfe7025..051223c43fbe20 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt16.cs index 756be87167c538..50fbafca782baf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt32.cs index 267dc277920dfa..2e70484fc8ceca 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt64.cs index 1517febd104328..4ef72a25c9149a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Byte.cs index 4a16a75660d416..7bab13a38520a7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Double.cs index 41a1fce2d261d3..8ee8d327a1e889 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int16.cs index 32cd9f4e16d813..a6b599df9cb801 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int32.cs index 46726381c2affe..a74d27ebff2f93 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int64.cs index fc25b03a8971a3..49656926e7440a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.SByte.cs index dc34f58bb066d3..0ab44e657e2fc7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Single.cs index 3ae45f190edf5e..3129978c595421 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt16.cs index 106360a5c7c7a1..c25fe5fc38b710 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt32.cs index 021afafe83b152..904f87f2866a0f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt64.cs index 377d573f82964b..9d778384fd946c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/GreaterThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Byte.cs index 67c1d61603010c..b759c0cbedb783 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Double.cs index 3101f963168c65..4b2ab494c9617b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int16.cs index d0ab0b34eede3f..a68933793822ef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int32.cs index 83e395bcefded3..2d361b82ba61b0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int64.cs index 048e2ca724ad34..0f979382573a74 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.SByte.cs index ad3b13bba4968a..6eaac1d2fb621a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Single.cs index 41324a3a854a43..01c1a4484116d3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt16.cs index 902fae175da567..4287a657973e41 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt32.cs index b53b485aa87748..51bbabe070fbc7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt64.cs index 79d36b5aa25749..45d533c7d8c81c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Byte.cs index dd0ba62ce64791..257b0a466f3b2d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Double.cs index 2c8a78ff71a362..b9bd57acd304a4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int16.cs index 319602d129d091..353805133bc7d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int32.cs index ab25c55abae527..c6bbf163e53e1b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int64.cs index 68d096ebede374..514f9c9761d033 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.SByte.cs index 2c07ba25a60719..7197e556332c85 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Single.cs index 054c2169b97190..1d529b2d1e1c34 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt16.cs index f4fe74d0a62233..b275ee00b79679 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt32.cs index b0ef11d84ff6d4..1e9308ed0c0017 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt64.cs index cfad7a0af05db4..3e5725d594b951 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Byte.cs index 4deb0719079493..8bad0954f81e96 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Double.cs index b27eb422210e1a..d3e7bca443f945 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int16.cs index 81be2aff20f9d1..b5187f8eb16482 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int32.cs index 577395c0561179..484b1713e1f7d8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int64.cs index d656bb4322b018..03406fd0017ea7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.SByte.cs index 43a62d7206bde0..eb775e857adc7b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Single.cs index b05078bb9da54a..61710c9d8ee851 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt16.cs index 080064e390a58a..26ce835fb8bce8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt32.cs index 40a5327d0d6f68..64d0620b7114c5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt64.cs index 6a5543d32e76e0..8001dbed00d1cb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Byte.cs index ea80bb82a443cb..91335b4c4e375b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Double.cs index eda5dbcfcd5398..52fc4730018cb0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int16.cs index e3bd8e61f75202..1b91acac68ff83 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int32.cs index 1a464d42268324..7b84b2c925dd06 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int64.cs index cfa1fa93b02c76..7a1cc66bd0aa24 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.SByte.cs index fc0d15c2bd0cbb..5203ba8a0e9caa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Single.cs index 4c111b0cc0b142..b4d5d78a38f3aa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt16.cs index fc3f971446d290..b699ef08e561e6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt32.cs index 35f321b4bfb1fd..bdb95b9ab3618a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt64.cs index 93f479ce9ae08a..44c1d11cd1bf17 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Byte.cs index fd7dc6dff53bda..1a5cb5c479f236 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Double.cs index e11c655c954a63..97936e9dbf51b5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int16.cs index 34a76b550d955d..31d4dbab971add 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int32.cs index 436ff10f0c2e2d..5c2de82d5759a4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int64.cs index 6cda3162a2f2fe..10161d6aa5db2d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.SByte.cs index 9c9d03928e865e..e42c5648a1aff1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Single.cs index fb2cffbc5a0b69..26d40bb85793b7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt16.cs index 4df78e07770d71..74ebb9b8772037 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt32.cs index 249565ea1fcd98..ee7adc2c4b1cdf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt64.cs index 89d74a97f1284b..4dbd1ee4164a99 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Byte.cs index 6a36e84b42de4f..54a57814a1ddad 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Double.cs index 150d53244f20bb..8922428ee1aee7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int16.cs index beeb37e7031ac1..6c9dd8e9b64b7b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int32.cs index 3ef87ac4f85f04..c6802d17f9a81e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int64.cs index 48098c85866961..06003efa776324 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.SByte.cs index c4c59be579bdf9..c7134ed3ce2ce5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Single.cs index 26613cdf1dbe18..38f9d7bf1c6046 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt16.cs index 663390f919ca22..c724a83cb410f8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt32.cs index 37686e3b8db7a5..281f47f410f3c0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt64.cs index 5e347c53306f27..d895ea75bfaba0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/LessThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Byte.cs index 7b46294d433e95..f947b02567c777 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Double.cs index 5c7fe6874cbf9b..601df2c2b56037 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int16.cs index a2426a499f2490..aa4556bdc66469 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int32.cs index 459ef172d9b4d8..e3935027b39b99 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int64.cs index b78a89ada2e6a5..4598cd63434197 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.SByte.cs index e02c38ac420f89..d753d20f985afc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Single.cs index 2e8662dd82dcc4..cc70945f9d5f21 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt16.cs index 37da67740d7d68..46f1ca8c7f7e33 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt32.cs index 71957b52a49fba..88adb4c8042da3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt64.cs index 300a67eac78ac9..cf38d3a6875703 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Max.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Byte.cs index 8dc93ba66d11ae..f7c3c71329212f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Double.cs index 3f9a48953fe195..00275551015249 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int16.cs index 8b374635d7482c..5d102c248d818b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int32.cs index 66fae0a903000d..d664030fbbe8f7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int64.cs index 8a8490728f5093..f38117202a4bd4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.SByte.cs index bcbc5a6ac24cb2..34128fd5f080a2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Single.cs index 8a919ed075f387..4d030e94d640df 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt16.cs index e0101b32e32252..621bfd1fa29934 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt32.cs index b3e3de31a219b4..28ed4580c8b7ca 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt64.cs index ef2b6685590b64..5e65903e17bccc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Min.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Byte.cs index 66c263d6777de7..58006e730c0518 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Double.cs index 2a2a2abbc6f6df..85bdf0642e4524 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int16.cs index 7ebdb7e6d0889e..6a458b377d02e0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int32.cs index 7a0ee59f063410..3e2064fe394444 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int64.cs index 6e4bd1b90792b2..295485858a178c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.SByte.cs index d48ee35e0a8775..d7e1810f39e951 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Single.cs index e4a7c4855807b0..49cde23ebdd3b1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt16.cs index c871404d142eea..ba384f8371c108 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt32.cs index c35ae2922d6801..def177c017b31a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt64.cs index a056fdf1ea1c8c..4abfdc523b01b3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Double.cs index bf794aa1e4426f..3d7278c5b45a5d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int16.cs index 860ecb7ed384ab..b594604232ba34 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int32.cs index c07db094754a5c..a07f5333049f8c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int64.cs index 2f465e0601fede..fdadee89100124 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt16.cs index da2eb839a3034f..16e69d10503326 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, Byte[] outArray, int alig int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt32.cs index e6555866c886d2..c75b0842072000 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt64.cs index 064ec712a2b904..99a2535e05aa77 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Narrow.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Byte.cs index e75c6b097fb6ba..55c89e6552512f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Double.cs index 87e2df6664a7ab..5cecc6c429ebd6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int16.cs index 9fe3e8b3e5364c..b47750929c53e9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int32.cs index de52dab5a503c3..a3b9b5f355fe1b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int64.cs index b3e5b241945b8a..a027a005193048 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.SByte.cs index 82cf8cd256c63f..76ab7560aeae76 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Single.cs index 01d789af0fd04e..b2bcbd1b1d6bcf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt16.cs index 7274e5ef6cf0ba..59bb436d689ddf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt32.cs index 599699b48dd9d0..ea9f13334bbefd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt64.cs index 73fede7f09ba23..3a01b0ea6b7d28 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Negate.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Byte.cs index 415b1c5e07bf2e..384ecdda55c1d8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Double.cs index cbef5f9def7ef4..4e33280707b929 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int16.cs index e43e2840ffdbaa..f5922ca8c486a0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int32.cs index 62df33635887a8..d4126af8c1f71e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int64.cs index 7992189846a52d..a493e13028c8c3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.SByte.cs index 77110a5b7354c5..cf85d7edc4cecd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Single.cs index d7bc575cac08c7..bf50eacb76144c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt16.cs index ace05e29439e87..0882af9dff110d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt32.cs index 176c13ff452878..a334d594ccb37b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt64.cs index 76f897df30b361..c1b9080d09abf1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Byte.cs index a59033003a61cc..8339dfdbaaefe2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Double.cs index 176e302524dd81..eed3638925dcbb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int16.cs index 42939372c14dd2..3965f7020ab76a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int32.cs index 4e55a1e8f51cb3..83ee6516930bd1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int64.cs index 2874e0391f7273..b34710af46350a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.SByte.cs index fd33fcafd97c20..ac8962bf633671 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Single.cs index cae12d1bef00ef..afea13df6ec2cf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt16.cs index 8cbf29c9b52205..efdd08f19ff87f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt32.cs index 9a61de2c2d3456..f8785661a33cd3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt64.cs index 5772ac4dc7abdc..4b6ebac6dae0c4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Sqrt.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Byte.cs index e5026dd1e159bd..3cd5d6a69c81df 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Double.cs index 1baa057b9d9c65..9491fd7a6a72a8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int16.cs index ca8d804f3cf797..9505eaa4d5551f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int32.cs index 6138f9aa1905a1..e89aa568e0e658 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int64.cs index 76e9af39bc00ce..83186ea4d023ab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.SByte.cs index 93aa76ed808dc4..89552dcba1ac60 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Single.cs index 05bf517b6523d0..8a2f615d3c4213 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt16.cs index 2c4419dbe93d3a..a25317f483efaa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt32.cs index 86572829cb6a07..87e843f19616a2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt64.cs index 39ebab11bd3525..f1aa5ac742c284 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Subtract.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Double.cs index 32f3ee39bf1549..63b223cde86f72 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Double.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Double[] outLowerArray, Double[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int16.cs index 8ba2ab64bb0cc4..b27b30d3fdbd4a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int16.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, Int16[] outLowerArray, Int16[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int32.cs index 939c91f5b343a6..a9bfcfbdf8743e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int32[] outLowerArray, Int32[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int64.cs index 5ec3c7c73bb45b..a55cd0747f92dd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int64[] outLowerArray, Int64[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt16.cs index a668afb9c77c89..dd068944edac35 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, UInt16[] outLowerArray, UInt16[] outUpperArray int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt32.cs index 84d7515441168b..fe69e46345a891 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt32[] outLowerArray, UInt32[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt64.cs index b4acabd2d061f3..a5f812f006127a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Widen.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt64[] outLowerArray, UInt64[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Byte.cs index 16eb68e80e2d2c..e973e3508f7923 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Double.cs index 8f66ac14446117..0229ab16a8d0d0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int16.cs index dddc72db6d2404..8a940aa849d235 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int32.cs index 4c9ff95f42f1d6..c16e4c9481c3ab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int64.cs index a03e5edcc4cc32..a4f2a76f610504 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.SByte.cs index db14dd6b1ccab6..db55fbebcd30e6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Single.cs index 4f18ff114eaebf..62806f01f5ccac 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt16.cs index 398e4d794d059a..2fc481dcc2de57 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt32.cs index a777992757faa9..1d798b56db25ee 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt64.cs index 65f9f83e892c44..424ede42842e8f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Xor.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Program.Vector256_1.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Program.Vector256_1.cs index 4b66bda1b1c0bf..bfccc8223160a7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Program.Vector256_1.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Program.Vector256_1.cs @@ -3,6 +3,9 @@ using System; using System.Collections.Generic; +using Xunit; + +[assembly:ActiveIssue("https://github.com/dotnet/runtime/issues/54122", TestPlatforms.Browser)] namespace JIT.HardwareIntrinsics.General._Vector256_1 { diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_r.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_r.csproj index e5621240814339..30f75cff13bc91 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_r.csproj +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_r.csproj @@ -2,6 +2,10 @@ false true + + + true + true Embedded diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_ro.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_ro.csproj index 1878d6f25f9333..e2935da1b9475a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_ro.csproj +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_ro.csproj @@ -2,6 +2,10 @@ false true + + + true + true Embedded diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Byte.cs index 0447d1fa704cd8..d85f2a23336dca 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Double.cs index 4eb227df886dec..58babd78b036f9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int16.cs index d63d7585d5249e..b7518f10fc584f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int32.cs index 459c40919c4f3a..aad03698604b3d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int64.cs index bf33c287efd318..784d2e4e4e9bb3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.SByte.cs index 77798dbe9a2070..2110c6edc4f0f9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Single.cs index a54a88bbd39c7f..9dc4ca3ef7bbbc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt16.cs index e662c788b66aa7..91c626ab02bad5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt32.cs index 2ea71d97552e4f..2dfc9ea01b2083 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt64.cs index b914a0ea2d7633..60827b04149037 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Addition.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Byte.cs index 9f2138731929e8..feb533caa3d709 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Double.cs index 16699d47d0551e..b2290ce43813ae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int16.cs index b91c75ae7dd97f..4eed2d8f88b27d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int32.cs index 4dc09dba0b0583..52c1bf0c1cb3a5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int64.cs index 43cd7b8e61f89f..a2273a8ba5752c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.SByte.cs index d305454e394f93..c6abafc13af1ed 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Single.cs index 5caad1f3889655..3ae7bd45276387 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt16.cs index 81e9ebe1c787ef..05369ef0263cef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt32.cs index 6a920bd4d33575..41ea1428323aa7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt64.cs index 2b1234630a6ac7..da74ec45714f19 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Byte.cs index b1e0355cec0b1c..72f28f17b2d734 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Double.cs index 7e4ad6c75ac103..430e6e0a9a52ff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int16.cs index 23f9027a09caec..ea38671d33a462 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int32.cs index 1ea8f8a06f1eb9..bdfe85606ada35 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int64.cs index 12d91351f175c2..3d2133bae3a4b6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.SByte.cs index 8daeb6adca1908..f4349f9c16877e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Single.cs index 9ebb0d674c896b..0498478708530e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt16.cs index dcbd12f0ec6c3a..ef4bde2dffd32a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt32.cs index 634880950b960e..7cdec16a5cdca6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt64.cs index 2b48db2251aabb..ef27c1681a4fc7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Byte.cs index 969f1e50321ce7..fa9a58adcd8bd6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Double.cs index cbe34d206d3622..79715b2aeaeb85 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int16.cs index d476ffe0d98a3f..d284141acafa11 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int32.cs index 6e7fa7059d9d7f..7a6d62030bf8a6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int64.cs index 15e4f47c56024c..e3fba5f8245e7b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.SByte.cs index b4af45b1d23df2..75a70d0ad834e4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Single.cs index 551bfff1e36e42..74649833576b3e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt16.cs index 1199ad63cdb9d4..7de77256862338 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt32.cs index 0d74e0f700008e..0ed53d6bae75f4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt64.cs index 841ba28ad471a1..d57b6719b14980 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Division.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Byte.cs index 3e55b760f08b52..3c8a0aeaf074fe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Double.cs index 88fcd008bce7b4..e8f9dc677d2770 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int16.cs index bef9ab1a4705b9..97011343a5c413 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int32.cs index 266cc33fdd8bde..225e8514b3f1af 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int64.cs index 464c8dc3aa6f48..fd50f1396c7b8a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.SByte.cs index 2c10b3df229227..390499451cc043 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Single.cs index 54a731f3326d43..43df6badb6c655 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt16.cs index ffb6bbe9ff7bde..2cba3275321884 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt32.cs index 4267ebf60b5a7f..27f04f93199b82 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt64.cs index d21a1e50288356..28d8676c7bb3f9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Equality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Byte.cs index 7347e0cfcb7936..286c59151be92f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Double.cs index 50a69cbf99b8f0..8d17b7a183200d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int16.cs index 2e89f2c330ceb0..d80d8dd4e8820a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int32.cs index 38cea11a19d84a..fbaa8774d38c85 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int64.cs index ab52d96c5a2469..6bdadee5c8088d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.SByte.cs index d3ca82f3ca9205..29a63ce514c0da 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Single.cs index df4f9549a1a0f7..99865f4c7b24a4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt16.cs index 8f4f69f15b5a2c..9764ad9c730252 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt32.cs index 99f484cb66bd62..ccbd9ce25f3e5f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt64.cs index ba0dd1c078dab1..e3cdb6097fc241 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_ExclusiveOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Byte.cs index 25834838d9ad29..6185d29de1baed 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Double.cs index e6044687f9bb11..81966f3bc3bb9e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int16.cs index c3142804265ac4..fd71dee5bd6ed3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int32.cs index d8fc09f3c4626d..588cc1586cf418 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int64.cs index ce5e5368b8157a..b4b41859291b57 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.SByte.cs index 721240fd4d7ff5..b18063f9e47a54 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Single.cs index c2ea914a7cc617..9197c6db8e9c28 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt16.cs index 74711dc2cb454c..8769a40cf330d0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt32.cs index e080982400524b..0ad42a67c0228a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt64.cs index be589ac07d7d77..701c0a568730da 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Inequality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Byte.cs index 89889121ebb34d..dca0dd1f805c52 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Double.cs index 8325e02b27b6db..487df0ed678911 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int16.cs index f0447e4048b628..3b2142cee6e735 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int32.cs index 329d4ef32d9abc..40f65ae3be1640 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int64.cs index 79f6468f6ecd3b..0374ab70be075b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.SByte.cs index e50238b9619bb5..520a30bf4f7e36 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Single.cs index 688daa40abf805..93b8558869a29c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt16.cs index 60e85d3aa5ba5e..419bcdc742d0a6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt32.cs index 8b9f3b023462d3..a6eb3aa4ab526c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt64.cs index 3d535c26b96eeb..7c9d4b1a1e0dd9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Byte.cs index c1445d4e502671..303d2e6ca66031 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Double.cs index ab63544b35485d..7bf3d7c17b8f5d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int16.cs index 46a4acc1163e0e..379d8e56e35492 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int32.cs index 479cd6c6b95920..9b4dd1b5549155 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int64.cs index 043a894d542411..24bcf2c7e6e8f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.SByte.cs index c92191eb36d083..09b5ccf7dac51e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Single.cs index 2248c057bbd1cc..679c1a6aaffe62 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt16.cs index c67aa416a77aa4..8a625f9b185ff7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt32.cs index 073c6534931570..41652f72a0cd0c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt64.cs index ffb9517b946acc..96d1d0f5a91f12 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Byte.cs index 847d143cefffa3..b0a0fb3e7899a8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Double.cs index 505aea8f9a9654..33ab56a5c12845 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int16.cs index 6a989e68102563..b241a50853e2c3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int32.cs index e39d68813657af..588d9a4356e4d1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int64.cs index d8587ebc709b4e..21cebc6eaa40be 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.SByte.cs index 63759139d3b893..671f3f48750d49 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Single.cs index c21338aa31acf6..ca923145944db1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt16.cs index 860d605d9a4c62..2fcbf14c1d0292 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt32.cs index 7eed55483adbfe..ef9abfb5114a42 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt64.cs index ccecb61562ccf6..5c29c5ae8e18ac 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Byte.cs index 1a87c56749c838..afb2407a51ee7d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Double.cs index 8c87c70f2f41d1..d3e33b604d7899 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int16.cs index 89c7b63d049636..9d86354ec4937a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int32.cs index 9afc94cbd775f5..1a22e94910dad0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int64.cs index 9f867f9228ee65..f5703dcc7c9ebc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.SByte.cs index d3b0408e206c4d..677beed3493aa8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Single.cs index 6bdd38ac8c8ed8..3de84f1c106a3a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt16.cs index f27b805624b20f..233dfa96eae0fe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt32.cs index 8dc2cf271e41e6..55ce949045be7d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt64.cs index e585bcfc5c274b..50618939268b1d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryNegation.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Byte.cs index a8a4592af836d2..14ddd64393bee0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Double.cs index 00d5e428420cd5..000d04c8f47101 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int16.cs index fd7e68fb0aa79c..568299a53abacd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int32.cs index 9b4da2b316b4a6..62a7959f8d39d4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int64.cs index ce26af3f422065..154004dd83ddd3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.SByte.cs index 1929f7c55f8b68..6e324c668efd52 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Single.cs index 1f93f4e39f2e39..292737036d4276 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt16.cs index 6254dd5323f57f..b4adb69e29d123 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt32.cs index 220cc30360b4bb..335eefb99179f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt64.cs index 3b44d959099e24..a84c71283b49db 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_UnaryPlus.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Byte.cs index 16a0dde72e0947..7cf4590c5658d0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Double.cs index c913070c7a0d7e..c3ee9227911e69 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int16.cs index 4e00cee9552c48..aa1858eaa4bb7e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int32.cs index 12cc136324b600..1358e6555cc4ae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int64.cs index de5be99b126e25..bc4d97249eb9c3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.SByte.cs index 220f1012c3f765..3812beb4121352 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Single.cs index cd2929de6dc863..8327b95be75aa9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt16.cs index 84cca4dc37537d..ec9b143c9f9360 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt32.cs index a7aa303252c877..974bb03f3fbdfd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt64.cs index 85588bbcc3087c..06cdce6b5aeec0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Abs.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Byte.cs index 7bae91cf604b43..22de7b63e50fb0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Double.cs index 52f335055cd073..9f71e7dd08ac10 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int16.cs index add68c0cfa80c1..93f8fee2e4b650 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int32.cs index 5e9d732b69fa29..17c7c29f277d58 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int64.cs index 19a83b236c1255..b3e1b5bb9d886a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.SByte.cs index b789e2dab66623..b3296ec60e962b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Single.cs index 82431e84724e46..02c2345a9c57e1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt16.cs index d08253492b84d1..22b7e1d83115da 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt32.cs index 8178422430c0af..215dfbb41afc2e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt64.cs index abe226e174ced2..f8464b487df613 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Add.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Byte.cs index 97da1fa45f2dad..16711035c30624 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Double.cs index 4ffc6364266964..1ade698b070f2c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int16.cs index f290519ab21f2c..336f40d2004b5d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int32.cs index 8b646f92ce4ca8..02026e9ce2e89e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int64.cs index 3adc95d0be0f8f..a798901a6200ea 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.SByte.cs index c615373f3f35a2..727fae56778ac8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Single.cs index ce7651e442d5bc..4eb739e5d121c7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt16.cs index 0bf9b23b0a9c41..ade854041c2908 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt32.cs index 91cef940fa1193..8d03705bbc450b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt64.cs index 0071257eafd541..995adf170d5969 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/AndNot.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Byte.cs index bd0342b4bd1b37..1934bb2bddf7b9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Double.cs index ed321f3c768374..c2edb5c1720cc5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int16.cs index 6c093251283f0f..e66fd3f806140d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int32.cs index 37ba2cb1c49b74..e1099772c00d34 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int64.cs index 2ed2d011858b64..7bc22199c288c7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.SByte.cs index 0c02beaf7657db..cf6acf66b057cc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Single.cs index 1eb0a7c9aa3385..a043c1243bac3f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt16.cs index a71379c29e8ee7..d7d617f44d6d9e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt32.cs index 62a9e1eefa41aa..513fb792780e89 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt64.cs index 31d6c9e8ebd4f1..90b74f04939c4f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Byte.cs index 675fd7bccf235f..7012dea86b853b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Double.cs index 6c6285610d2d38..47ee473f787f8d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int16.cs index b5c83c9a914bf9..674b9e4b3e28dd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int32.cs index f223580c31d0ed..fa19c118d8be36 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int64.cs index ea2d3b603962d4..014689c7f55a3f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.SByte.cs index ed0768fab3c06f..827a45a1c2fb2d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Single.cs index 9f721186c9bf69..fa3525d326f9d1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt16.cs index 4d51ec1f44baa0..8436c9a4d563dc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt32.cs index c1dc519545e446..83fbf2176cd302 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt64.cs index ff43c8c802c850..a7f7bb6741fb3e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Double.cs index c29680b1e528f9..26d6cee59fc904 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Single.cs index ea55339bd109d4..923d2ea340ee40 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Ceiling.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Byte.cs index e2f4f0fa7fca9c..a9baf520539450 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Byte.cs @@ -76,7 +76,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] inArray3, Byte[] outAr int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Double.cs index d85f458f6480b7..354d6238a3a3e5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Double.cs @@ -76,7 +76,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] inArray3, Double int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int16.cs index f59e842a1d012c..648f7ef19a40f0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int16.cs @@ -76,7 +76,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int32.cs index ba2c8bb36afd63..72dc5f9e27391d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int32.cs @@ -76,7 +76,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int64.cs index 5fb71dbaa07140..022aa8cc9d7b6b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Int64.cs @@ -76,7 +76,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] inArray3, Int64[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.SByte.cs index 775e561282e630..29905dbd3e6c83 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.SByte.cs @@ -76,7 +76,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] inArray3, SByte[] o int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Single.cs index d3b2ea6aac773b..02cb0ea658cb10 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.Single.cs @@ -76,7 +76,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] inArray3, Single int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt16.cs index da447c61dd15f1..1365f22f394a3b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt16.cs @@ -76,7 +76,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] inArray3, UInt16 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt32.cs index 41a1208b73a7c2..42342abbf30caa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt32.cs @@ -76,7 +76,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] inArray3, UInt32 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt64.cs index 806f792a4e94c2..3577e50410587b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConditionalSelect.UInt64.cs @@ -76,7 +76,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] inArray3, UInt64 int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.Int64.cs index 798bd082e20861..c44e95b46b9f6a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.UInt64.cs index 8a0f34022ab540..1aa28fc2089b42 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToDouble.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt32.Single.cs index 1d85753bc0747f..7699f979bca9f7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt64.Double.cs index cb4f5a28be0e68..1d3f2a777715df 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.Int32.cs index d05f27cf46173e..e55e86c8ad93da 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.UInt32.cs index 3b7abc04f75769..a860a91ba66ebe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt32.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt32.Single.cs index 6a790e64568d5c..88ca8ec4dd51a2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt32.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt32.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt64.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt64.Double.cs index 418177ac5adc81..550fdfc72bd48c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt64.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToUInt64.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Byte.cs index e42b25b3c418b6..17dd4531e50680 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Double.cs index 22717fd3089690..5953e5cd14b5ef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int16.cs index 5a9bcf691a84ad..ae0b977b86dd25 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int32.cs index 3a29e6e304c5e1..cb73d60b04e8c7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int64.cs index 87eb7fe18b3d9a..bdf70e352653c5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.SByte.cs index 013e4c57e7f720..aae38738924b5a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Single.cs index 3aea98ff2717c3..3b06c690efdbd5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt16.cs index 160191be8f9b96..2a92aa7e7a2f4e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt32.cs index 5ec2776098b86f..f8944849bfad16 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt64.cs index 6784bdbee3c3bc..82e24be513a5af 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Divide.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs index ded616bf9f2c5c..8c1916f0a858b2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe { bool succeeded = true; - Byte actualResult = ComputeExpectedResult(left, right); + Byte actualResult = default; + Byte intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Byte)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe Succeeded = false; } } - - private Byte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (Byte)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (Byte)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs index f2ffbf02bb4699..3e16d1b52a0977 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle { bool succeeded = true; - Double actualResult = ComputeExpectedResult(left, right); + Double actualResult = default; + Double intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Double)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle Succeeded = false; } } - - private Double ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (Double)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (Double)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs index 48eb7f189fdde2..283182815302ee 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe { bool succeeded = true; - Int16 actualResult = ComputeExpectedResult(left, right); + Int16 actualResult = default; + Int16 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Int16)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe Succeeded = false; } } - - private Int16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (Int16)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (Int16)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs index 9811a236de9f36..6cef7996fa5511 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe { bool succeeded = true; - Int32 actualResult = ComputeExpectedResult(left, right); + Int32 actualResult = default; + Int32 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Int32)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe Succeeded = false; } } - - private Int32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (Int32)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (Int32)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs index dc678c0aa7111c..81afde657ea149 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe { bool succeeded = true; - Int64 actualResult = ComputeExpectedResult(left, right); + Int64 actualResult = default; + Int64 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Int64)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe Succeeded = false; } } - - private Int64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (Int64)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (Int64)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs index f2aad6a809f3c7..00cbbbb9d74c54 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe { bool succeeded = true; - SByte actualResult = ComputeExpectedResult(left, right); + SByte actualResult = default; + SByte intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (SByte)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe Succeeded = false; } } - - private SByte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (SByte)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (SByte)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs index 550450092bd975..07eb92525d3df3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle { bool succeeded = true; - Single actualResult = ComputeExpectedResult(left, right); + Single actualResult = default; + Single intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (Single)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle Succeeded = false; } } - - private Single ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (Single)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (Single)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs index 8fd9072155837f..faf377ba303073 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle { bool succeeded = true; - UInt16 actualResult = ComputeExpectedResult(left, right); + UInt16 actualResult = default; + UInt16 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (UInt16)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle Succeeded = false; } } - - private UInt16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (UInt16)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (UInt16)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs index 8d01c3bedeac6f..2cf6647483e17b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle { bool succeeded = true; - UInt32 actualResult = ComputeExpectedResult(left, right); + UInt32 actualResult = default; + UInt32 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (UInt32)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle Succeeded = false; } } - - private UInt32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (UInt32)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (UInt32)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs index b73d037c4a4ccc..8fddb15edc6d4f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,7 +293,20 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle { bool succeeded = true; - UInt64 actualResult = ComputeExpectedResult(left, right); + UInt64 actualResult = default; + UInt64 intermResult = default; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ((i % Vector128.Count) == 0) + { + actualResult += intermResult; + intermResult = default; + } + intermResult += (UInt64)(left[i] * right[i]); + } + + actualResult += intermResult; if (actualResult != result) { @@ -311,30 +324,5 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle Succeeded = false; } } - - private UInt64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) - { - // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks - // as well. So we'll just recurse down to 1 element. This ensures that: - // * Vector512 is Vector256 + Vector256 - // * Vector256 is Vector128 + Vector128 - // * Vector128 is Vector64 + Vector64 - // * etc - // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` - - if (left.Length != 1) - { - int half = left.Length / 2; - - return (UInt64)( - ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + - ComputeExpectedResult(left.Slice(half), right.Slice(half)) - ); - } - else - { - return (UInt64)(left[0] * right[0]); - } - } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Byte.cs index bab7c333f5b46b..b9e3c51375f338 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Double.cs index ecfeace97c25f2..c552c6a770c441 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int16.cs index e34d56cb8b2ace..f9962b9c70bef2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int32.cs index f674b7f359e2bb..a6c0629223c042 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int64.cs index 3a4acc7b935471..d53a99239fc0d5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.SByte.cs index c78ee95c0a5355..4fb2459a65f0ac 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Single.cs index d9b6190f4ab215..dda646763eca3b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt16.cs index 75c1e5a59a5970..e8a0b35594b005 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt32.cs index 430bb1148ce560..075bb61379a22e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt64.cs index a09f46e379cca6..651e277c1dcd1c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Equals.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Byte.cs index 4c6e7064e1aec0..d1a4b431a7bcfb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Double.cs index 1fe1eb2852ea65..d0fb752c0b8788 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int16.cs index 6ecdc2eeb5a73d..df7a71712d5ffb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int32.cs index d18236815ac395..fddcfbb4d8aab5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int64.cs index 43d94e55e556b1..cc045b56295a48 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.SByte.cs index 2d24e9a30c2784..1bc9c5ba643a9b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Single.cs index c2f0e8ad1f92c9..b797aa6a96465a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt16.cs index df618178c8945b..04d8493a6d199f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt32.cs index 4a88d1125194c0..54a5d0af5fb290 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt64.cs index f9c24e84d6c358..da7d5cddaa010b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Byte.cs index 96dc141c34ed55..42917a870e0bef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Double.cs index 8abc92c5346c75..9d3b85d0adf979 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int16.cs index ddda05c42d61ce..9986850a5ebc36 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int32.cs index c7e3eabb86761c..4480e789f1bee8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int64.cs index 91a2779c309753..7d0da5fd1fa552 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.SByte.cs index 75851d3e38f76a..2dab1c39c57c9c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Single.cs index 4bf4a25ba71ca5..670fa1bacb6d8f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt16.cs index b3aef5868d341b..c0352bad65cd47 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt32.cs index 33f579817d4432..2f7fd91bd2fcfb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt64.cs index a1bd772869bad9..3d0f4c734847a9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/EqualsAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Double.cs index 7b25e6c43239b4..0df8dce07b9ca4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Single.cs index bc870602e306e6..11e87acbdf9877 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Floor.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Byte.cs index e05481be775c94..c66805b2d07d13 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Double.cs index 0d40a72100d89a..d3f86cf384cbd5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int16.cs index 138db4b7f0c25f..83298bd8e5c2b1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int32.cs index 832e047ef66a7b..d9f5f50dee00c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int64.cs index 487e64167e51c9..beea137784b32c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.SByte.cs index f7296d3b2fcb4d..2bd579a0ed8323 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Single.cs index ea8cf0051c89ed..25afb712ab9a2f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt16.cs index 1751ba08e3e1ee..e7ae7661661c13 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt32.cs index 444b8bed593995..116e07ed28a203 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt64.cs index 2f5e8364d9a49f..b8c51a10a5a475 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Byte.cs index ec2ae0f57b6650..0a788f005f1549 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Double.cs index b70144e71db32b..e956dec0d7a752 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int16.cs index 2a8a84fd63a7f3..86c0bbcf81d345 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int32.cs index 667e2d5e13bd40..59035aa3d76096 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int64.cs index d2cde08cf4578b..e0848576aa97e6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.SByte.cs index 369e4de03c6226..750792db8e0e7a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Single.cs index 3aaf08d84d9ea6..b5d2c695678d6d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt16.cs index 1704494c2e8d5f..1f768207168c74 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt32.cs index 74ddc1718c373c..e186c0ce4a69eb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt64.cs index 2b29ab6ec1fd3b..02ddb5fd779d82 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Byte.cs index 18770031be4144..4cfb1d07268fc5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Double.cs index b438e3e94bedf9..5174ffea7682a6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int16.cs index a963ebeabeb613..7b16f0de974fb5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int32.cs index 7605888860248f..a01482892ab8cd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int64.cs index 51bdc1eba3a767..63271a8eb1af6e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.SByte.cs index f286ae68d5b7b9..82a14d0077cd33 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Single.cs index 36990058738188..683cf82d1da27d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt16.cs index 66ca3c332810cf..1cdc897928aa90 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt32.cs index b7e115d128e80f..a8566763fe084d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt64.cs index ed8fe990809142..612a7780fa5b3f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Byte.cs index 0e840e5c96a3bf..28f7e6333968d5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Double.cs index d316ad9b712032..cb4daf7dd00d9c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int16.cs index ddb37d6f67ab30..a3a39769e9a72a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int32.cs index 31cc8cc0b4e049..22576427104a57 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int64.cs index 1abddb014066c8..76ef2ea1cc7410 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.SByte.cs index a9ae3791545e7d..07b14051dbf121 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Single.cs index fad20b244c076f..59fac01600be4b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt16.cs index 822eab77e4f96c..c28e224622f1ca 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt32.cs index 307be46cb510bd..a93e224c11edce 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt64.cs index 0d1df9f3e80e36..e9739b30403b55 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Byte.cs index ea0361fe4c7d5d..6af0edb07800c6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Double.cs index d83119084b6305..4748e0a27c13d9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int16.cs index 5540069fe176f1..7eaf5c398d9c27 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int32.cs index 677beadc26f450..6d3e9eed661f27 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int64.cs index 148e302c1c7dc8..9c085e119f7484 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.SByte.cs index aeddc3962544f1..dbb2a971dfba4e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Single.cs index d3847f4405f235..f5b567f55b68c0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt16.cs index 94183448392a71..1dcb4daf1f7104 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt32.cs index c3fd43eb104b19..1826dedefdd8ae 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt64.cs index 927adaa44edafb..7066f72cbfc711 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Byte.cs index 2b68979455be19..17f4fe254820e4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Double.cs index 572bf19b5d503f..2034aa4bcb5782 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int16.cs index 933e281bcaa917..9afb2c5ad58453 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int32.cs index 0c62fabd32ed6c..6be8a5c0192619 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int64.cs index 7d946d5db62459..a19452ca0d0a5c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.SByte.cs index ce030f08c96f59..f7dfb94e4bb243 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Single.cs index 703ce08dabaa92..fde2d47a6e424c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt16.cs index 701c1b42e6d830..86952b2cb0d632 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt32.cs index e5d1db6442eb3d..d78dc7b5c01871 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt64.cs index a4052dc1e1d112..4d28b038520306 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/GreaterThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Byte.cs index 4582435fc92160..af96b59f406a96 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Double.cs index d9082bfb4e63d5..2e16324099c094 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int16.cs index 49510a954d6be6..937a591ceefb8b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int32.cs index 23520406fcc350..f832296add5392 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int64.cs index 231254c49c6bbf..7048e880bf2462 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.SByte.cs index 3bb710f69f09e5..ce93263d7cc8a3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Single.cs index bdb3bcd35301a0..770b8c332855e9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt16.cs index 717623a880239b..2f3b5b5ac77554 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt32.cs index d632847a9766a3..cf6f1dd728a080 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt64.cs index 04494fff82e10d..15bc351a3232ff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThan.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Byte.cs index 47528badd0fd02..c94ffe18c306ce 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Double.cs index e4ae949fde7ff1..38f385775c4c99 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int16.cs index e38b28ad42ee06..b41e25a6c6f0c4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int32.cs index 1d9f795f25b4bb..2265dad9d40915 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int64.cs index 90ace5e7682aeb..10632756736019 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.SByte.cs index 7595d38c7c63bd..cf5047c1c9bcba 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Single.cs index 7dd6ef4368a104..3ab70a2ec9c0cc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt16.cs index ccd9fad0569610..9baebe874d9825 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt32.cs index e512e114242ce0..79f3f4ecc0a906 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt64.cs index 934f13f2d7f25b..1280a65c0aaea6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Byte.cs index 4e088d6c3c2ffc..b9d1b9e636271f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Double.cs index 2d3b08f6f2bbeb..b0c4b1bb85f040 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int16.cs index 2491082bedcf99..7b57110c44195b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int32.cs index 9cfeb26e968766..a10c4dd1fc1138 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int64.cs index 61b6a3347058d7..9bd1e580360b3f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.SByte.cs index 977ff29c06e42b..0a2a418adb76f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Single.cs index a81ba07abce123..cce869ccda2788 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt16.cs index c46a5ee0bc2f17..b13e712beff2f7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt32.cs index 32f2fbb9650121..46c8073131aa31 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt64.cs index e85f8f7692075d..a3457fd036a90b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Byte.cs index 9b1d0b46de1646..e9f72bfad7dfb3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Double.cs index 8bdcd42cfc57ae..a3794652de6b03 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int16.cs index 6f762f161ded43..0dc54a822f88f9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int32.cs index 9003fb4094f592..314b41ceb3e813 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int64.cs index 032356b592d2dc..c4fa9f3fd6e5a7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.SByte.cs index 0d4a706fb47dc6..32b7065a85b379 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Single.cs index 5a8f084b33f88c..4db8f3452008e1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt16.cs index ba19b7fed09235..8074b7500475eb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt32.cs index 70515a4c1ea16d..838dd5acf6477b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt64.cs index 16a83a3cd1df95..5eea2cf8a4b328 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqual.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Byte.cs index bc027e49445752..f3e86eb0a78454 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Double.cs index 035bdbe2563d03..04ec56077d07c9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int16.cs index 0aca4cbedbefaa..d958683e6514f7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int32.cs index 642313d7c27b8e..f0fcd339220e24 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int64.cs index c7877d7de95d95..b98274bbc1fc8f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.SByte.cs index bb3718419baaec..635b0c54490b38 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Single.cs index 4e0b4ae85dd238..773734c3ea32b1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt16.cs index 65d954ac32009c..daa940c382ce5c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt32.cs index bc4078beb05a68..6d2539df18dd56 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt64.cs index f5e179fa3cc2c0..06ff1e9c0a9aa0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAll.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Byte.cs index 0a676cac0f315d..191fbda6b49d54 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Double.cs index 03860441783cd6..ad93b74b9a99c7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int16.cs index 2dc0611165f150..476791a78b441d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int32.cs index 0e4b35262a7b0a..ea2e1a4d720089 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int64.cs index 9211a6b290581a..4a0c21539829e1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.SByte.cs index 18077829eed5ba..87ec23d9247e51 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Single.cs index 4b5e203d6a13f8..0be70558dc1bfb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt16.cs index 5c95df35afe78d..51113f57c60dd5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt32.cs index 68a2df713da285..71c70b65120fc6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt64.cs index 40615a6427fe11..53a5546b49a5b6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/LessThanOrEqualAny.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Byte.cs index 66a972d2947f33..7989afa988ba64 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Double.cs index b080d35856ce3d..8a7f96ec4bd3a6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int16.cs index d9529dd156dccc..50a4b7a5ecda7c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int32.cs index 7dae3afaf68088..dc015a84911c91 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int64.cs index 65d3dcd29877bb..fa10ebf5b4a2f9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.SByte.cs index 571b8db6a4b0fb..4c80c7a4056b97 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Single.cs index 068b33589eda5b..b48921152e80a8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt16.cs index 259875955b007d..412858e43199d8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt32.cs index 4327604777b8d7..446bdf84dc7d7d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt64.cs index 9b6810b0108c37..69939b43dd6ca2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Max.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Byte.cs index bc4729862c3a47..5b2990a20de02d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Double.cs index 82ccb2a3b94101..580a669ccbf7cd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int16.cs index b216643c32e5df..bf2d4e160008e4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int32.cs index ab9bd6b290244c..19582707d2d196 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int64.cs index 5428e7ac0ca7d6..abf12400a9ce29 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.SByte.cs index 3ac155555065e5..3a217cee2c9d48 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Single.cs index 2b4da9c7dea83f..44bb74c57d83d0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt16.cs index 756fd1c8d0badd..e12476c8e74707 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt32.cs index 7803b1922212c6..9c5e7f8d656a5b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt64.cs index 18c967c3dbf676..480c9a90f2e3ba 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Min.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Byte.cs index 1f339c0da86aa3..09ee6be434f0b3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Double.cs index 82b01ba0604712..6e91f67370f1a6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int16.cs index 7fd8ac2e24edbd..651c842a067621 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int32.cs index eb97a888bfe33d..e5fa07d62aac14 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int64.cs index 7f59a166f52d03..edb50aad4b9b9d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.SByte.cs index a281d52abb5594..f72ac0702c1358 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Single.cs index 57ceb8833ba9ab..0167b87ebb9d48 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt16.cs index 718cf1d12e1ca5..4eaf2c00d16b88 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt32.cs index 21b2f1710d3045..24823d53036d05 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt64.cs index 12fc8204c015fa..b3b09be8c60dd1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Double.cs index 3ae2a23a54e090..1516d52ba65d5a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int16.cs index fc77d44472771f..d52335f6eafb47 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int32.cs index 722a87e1fc2d1d..02dca722991bf6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int64.cs index 0e88a190edf627..d97613e9da88e7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt16.cs index e10f22462b424d..a9cffb0191c61a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, Byte[] outArray, int alig int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt32.cs index 390e7710ccebad..5d1f5d68f67b2b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt64.cs index 22766d67fa650f..3b5f0f75716c60 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Narrow.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Byte.cs index 0e68ec3306a961..14cbccae435b5c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Double.cs index c597a9887974f0..4865168ed9d675 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int16.cs index 7f09a078e0e2b5..083eca24b99be2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int32.cs index e23aa39221025e..b7d20a64b07bd3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int64.cs index 996ecb74eb6a69..c4453681c1fad7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.SByte.cs index 2c6713d8df41b2..bf764cbb21e092 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Single.cs index 8d767fcf3b6bab..77070681283de4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt16.cs index 9c499448f769c4..15fe3a1181fcf0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt32.cs index 24266de1fe2780..a674716c7687fa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt64.cs index cd6aef380700b5..c4d753aa24567e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Negate.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Byte.cs index 5aaa741d825de5..2806f7dd70a906 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Double.cs index 71b368c152d083..b049749f6b7fdf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int16.cs index da0a9881537cd3..429fe34b1e2a95 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int32.cs index a3cf7966af83a4..5f644ca7d5d88f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int64.cs index 7e31e3550b98cc..f29e6bf2de7f69 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.SByte.cs index 98754eb723ce06..7c0cda7006a432 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Single.cs index b53b0578ecdd96..44dc6da1202b05 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt16.cs index 4b19002e9b05e8..45150ca658f0b5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt32.cs index f9fa485ced6448..8a7e15681518de 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt64.cs index 8a5f0f5baeef90..05d185cb3344ca 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Byte.cs index 063fbd9a9a1ef6..7b3100ea327e8f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Double.cs index a8700dd340a10b..8b1d3bdaa53f89 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int16.cs index 8a0899de69613c..431992e1f74e23 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int32.cs index 6cff4793e2d97f..8255690aeddc56 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int64.cs index 5aadf8cb2a80f0..5d390fff17ab20 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.SByte.cs index fb33947ca8f470..c63f4dd4e452b5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Single.cs index 4698f8bd6e5006..5ae409fc9c6baa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt16.cs index 295e78a44dd95d..7e2c9a9beba814 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt32.cs index bfbda14776a585..17acab4aeb0d9c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt64.cs index e4938386a0c0d8..cb0d0cd94f15f7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Sqrt.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Byte.cs index 528cfabdc40ea3..6631abf5803ce0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Double.cs index d03a8a61df87e0..4f0e79336b28cf 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int16.cs index 640a69476da471..ed7013d35c3411 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int32.cs index e407e28f80800b..319f7239e78adb 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int64.cs index 3a3439318bb829..30eceea6355c4c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.SByte.cs index 31c0266ee103cb..fff3b3eb68309b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Single.cs index a9b4db679d759a..8ec5cb059d4423 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt16.cs index fcf8af4884dfeb..bc2e34c71483a8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt32.cs index 8c98b57d7986fb..d727d667b1dac3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt64.cs index 5c42b6b9aa4e83..6cda1c1092e495 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Subtract.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Double.cs index de18ccd7da8d58..c54650cc0bd344 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Double.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Double[] outLowerArray, Double[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int16.cs index 7e1c42548497a7..8df7cd4d3a31ca 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int16.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, Int16[] outLowerArray, Int16[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int32.cs index e838f7ca0d5aab..9b1dd573496c00 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int32[] outLowerArray, Int32[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int64.cs index 7882c186e55161..cbe55d62bef490 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int64[] outLowerArray, Int64[] outUpperArray, int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt16.cs index 357f6eb815064e..38c659c3718151 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, UInt16[] outLowerArray, UInt16[] outUpperArray int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt32.cs index 1cd42a679e4ba4..3cd88a3562acab 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt32[] outLowerArray, UInt32[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt64.cs index 970e2eb4eb8419..794a88ef8cfe91 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Widen.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt64[] outLowerArray, UInt64[] outUpperArr int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutLowerArray = outLowerArray.Length * Unsafe.SizeOf(); int sizeOfoutUpperArray = outUpperArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutLowerArray|| (alignment * 2) < sizeOfoutUpperArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Byte.cs index dc92d532df8bfb..473c3ca515c46c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Double.cs index fcdd891b797140..8ae467c2228fd4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int16.cs index 8ef99b58b0eca5..50a46cbc3f9fe1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int32.cs index 5cc0ad008cf596..11277a4d196a89 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int64.cs index 3e8249f0837f02..ca8cab8adc8f61 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.SByte.cs index 8cebcc1fd68750..e6a66d1f6c697d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Single.cs index df9efbd62abc71..0f31ba087ffefa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt16.cs index 6f78deca4daf61..c7363316f2be61 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt32.cs index d5403b33873135..be3582d4029be1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt64.cs index fda3436e1a9dd7..57050e9d3a37d6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Xor.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Byte.cs index 4df9ae9ffb52c5..d595a9034f901f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Double.cs index 84029b9c4685a3..4656b99300e91c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int16.cs index b35dd4378d5eaa..52c66bcd58aa17 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int32.cs index 11cd59c4ffbacf..b9592a29576377 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int64.cs index 50ae3c19dbd73f..452fecf5b9f3d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.SByte.cs index 52b32ed51bbb38..9053245544ea2c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Single.cs index cd32b07b14036f..c086fee7a91212 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt16.cs index 4bd59043f310aa..4966192bcb4c01 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt32.cs index d656a27c8891f7..e4aed050fa08c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt64.cs index 3b7ca5b403dab2..6f38b7a38a0e6f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Addition.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Byte.cs index 7a0c4eb3860e4d..99650a1517c701 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Double.cs index ddab56cd3528c2..fb35d95ca9b673 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int16.cs index 334931fb6c1dc7..dbb6580f8e3646 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int32.cs index 64f6f943f56289..990acab3178356 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int64.cs index 6f7c76c42b684a..f541e5b92ec03f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.SByte.cs index ce5965b6ef8f80..62fb0ebe69babe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Single.cs index 710e91100940f0..4520e3985055be 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt16.cs index de6d6e7f4716df..d8232f0d75efe6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt32.cs index d4fc46a27968d0..13d800ea64e506 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt64.cs index 80bf76460a1225..5e1a8ab2c508ec 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseAnd.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Byte.cs index 8ad2a2b2302c37..7207b68507fb4c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Double.cs index 51e718953dd6ab..3b85f7a53abc52 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int16.cs index 97cb96b944e796..35217ec3b989d2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int32.cs index e9d9d06e96a12b..9dfd95e9cb696d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int64.cs index ce74a0dbb6a082..75fc58eb258398 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.SByte.cs index d9b5737797835d..0e995da5c6615a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Single.cs index 562d83347b7055..7f4052ace82a70 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt16.cs index 55f0f97890e3b6..e789b676480f8c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt32.cs index c2e0758ee8763d..ffea39d8092977 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt64.cs index 4e188b814c88e1..d032f6a1ac54b7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_BitwiseOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Byte.cs index 01dce0bf4d0a7a..5d900cd517164b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Double.cs index d4d2a71f301556..f287bae243a514 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int16.cs index 0165d4694d138c..1cb768fa698838 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int32.cs index c7d57d519ed0cc..8b7a7c38c24d72 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int64.cs index cd0234189a6744..867f03959f0850 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.SByte.cs index c25746a252b8af..9f3c3bbec73a6b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Single.cs index 723dcce509d3b4..0e286b086d9f8d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt16.cs index e91f8f8fbdcd6a..14d124220270e8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt32.cs index 3fd16b3fe5f6ef..82694d32784ad1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt64.cs index 40a8563d5f808d..07bd13d78429d3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Division.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Byte.cs index ee05a0b4731973..d666cfc618605c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Double.cs index 110434ed2f771e..07e3603a89399f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int16.cs index aa7416fa883da5..b96a373382315b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int32.cs index 9af9779023146c..39b1fbee523002 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int64.cs index 7e550b6559cca7..09442fc21cac48 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.SByte.cs index 7063fda2ce0a54..e5eadab3dba42e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Single.cs index 58b1e55f1ca08c..b54413e6f0fa61 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt16.cs index c86ecf95ae2486..65d8e12c86a2d5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt32.cs index 5bd33642c84f9d..05949053bf1b96 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt64.cs index d6354b125e9f77..d5bf3f32a90824 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Equality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Byte.cs index 9e84f805fac784..c975b052bd974f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Double.cs index d0b058f51df876..88351b78e7a73c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int16.cs index bfaf96410ac329..550a4a292d7265 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int32.cs index 56ba808d11e77a..f36e79b29a397a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int64.cs index 08c0943681e3e0..13350b335c7b6c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.SByte.cs index 43a7db7a82926e..2f02135e12e7be 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Single.cs index 0e477fa40b1b2f..a5edf018c46f94 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt16.cs index 28993387f5ef3c..e1f945b43fae0c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt32.cs index 642802d7ed1b52..fd7ead2afb1da6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt64.cs index f9ac99a59ac426..f197e84ad6ca7f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_ExclusiveOr.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Byte.cs index 2f34e8591be1f9..890af437d0daf1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Double.cs index 3d97ee64f0f1ed..5dc02bf9649229 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int16.cs index 84a3b6010caa75..5a584bf7bc3c5d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int32.cs index fc8a8a7e44d7af..d03e47b00af5ef 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int64.cs index c3da9ebfae445c..2ba022d7484fd9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.SByte.cs index c0020335ae8a41..8862113b9ddfb7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Single.cs index 43e3aac99da723..d1a234a42f31ce 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt16.cs index dc77ae6fe0ce81..a7747048fcac3e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt32.cs index d2c8bc28adda29..327943d4986747 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt64.cs index a99140bec397bc..d63988f1999a40 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Inequality.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Byte.cs index 3d16fafbf7bf3e..41bf13c2ed811d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Double.cs index aa739edaa465e7..16c0016e3d0c90 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int16.cs index 4662fb556b90ae..d597a34d341603 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int32.cs index 01a539d4a197bd..98167cbc3ccd77 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int64.cs index 1439f8d8322d80..13beed38b6cffc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.SByte.cs index 00b835aee50a99..d21c18aa0debf5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Single.cs index a4dadb19e64dec..63f370ee277650 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt16.cs index 2478adc82ffca6..384209ece0f309 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt32.cs index 6679d93c548cb9..a3e44831c7c12f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt64.cs index 32039a1928a2a0..63faf37e3cc922 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Multiply.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Byte.cs index 5a506bd4476510..b78810e542dc1a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Double.cs index 75c08ac9da7a80..92a5f634ed92bd 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int16.cs index 88ab8325b81d4d..6aace3b6cd0945 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int32.cs index 9edeb031c189b7..b1c9ce989c033c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int64.cs index 18f59232c2eb96..fcd88c9ad9d3d8 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.SByte.cs index e5f09037b3318e..24400e139c3896 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Single.cs index e6ff40fb22dc8b..c409ccd09831f9 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt16.cs index b44a868a1208de..79116507b9833b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt32.cs index 09215846c3f968..3faa70a13ca11c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt64.cs index 48c702b61b3f25..f92eac5df4b05f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_OnesComplement.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Byte.cs index 5e65c125c069b2..221d69fbefe56f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Byte.cs @@ -73,7 +73,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignmen int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Double.cs index 4f97454dee6801..db5eb1d9a47bb3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Double.cs @@ -73,7 +73,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int16.cs index dd49f4c9586003..0c06170dd079bc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int16.cs @@ -73,7 +73,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int32.cs index de477fdbf4b3ed..ca6c38765c506a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int32.cs @@ -73,7 +73,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int64.cs index d55318932a78fa..eb105d992a2b74 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Int64.cs @@ -73,7 +73,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.SByte.cs index 76d489912551ce..88bc61ad64115c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.SByte.cs @@ -73,7 +73,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int align int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Single.cs index 134394691d8f23..b6b3324763689b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.Single.cs @@ -73,7 +73,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt16.cs index 2d4efc28f4bc1f..4ffb85410f884e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt16.cs @@ -73,7 +73,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt32.cs index 688bf2a69e1e04..23a4fea6b96661 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt32.cs @@ -73,7 +73,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt64.cs index fa081d52a4036b..3ecbb3482c5116 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_Subtraction.UInt64.cs @@ -73,7 +73,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int al int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Byte.cs index 95c694184c1eab..783ad40bfdfc33 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Double.cs index d95b0efbd93ca2..522afa13365b0e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int16.cs index 6cad83b93853c6..0ee518f37f0a17 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int32.cs index 3cb51a5ea390a1..dc92b8da44c31f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int64.cs index 3892040e3f83ce..b02a23aadeba13 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.SByte.cs index 8b502e3fc86559..fa3abb749a356f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Single.cs index 88264a03f5ff10..4c3a0baea853fa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt16.cs index 0d785f50d6f067..c7be61abcfa196 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt32.cs index bfb8b35211e0b0..edd56a5b7fa2ff 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt64.cs index 2784450112c653..abfe5ac23b14b5 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryNegation.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Byte.cs index 22d84088d9e526..8aa5d7640c1e9d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Double.cs index 65a4a1353f0fd9..646785bed85d68 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int16.cs index 99d73215a787c3..81ec307deacd38 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int32.cs index 952e1da994b7fb..5954bade3e8b6c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int64.cs index 7325cf4461086e..a4ea207269ee2f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.SByte.cs index b044da7c0cfc2f..08a883dc60497a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Single.cs index 1a8f3348237acf..adbbc0d03709f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt16.cs index ee6de18f1e89b8..440b8795d8e2fa 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt32.cs index ab3261ef542c0f..22cbd383a2ee7e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt64.cs index 614928d1bd2630..eb84ffe5b51ffe 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/op_UnaryPlus.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); - if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } From dc43d8d592cbc1d412529255548966d25b2ccbdc Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Wed, 16 Nov 2022 09:20:12 -0800 Subject: [PATCH 15/26] Do update the Dot tests to have the updated validation --- .../General/Vector128/Dot.Byte.cs | 42 +++++++++++------- .../General/Vector128/Dot.Double.cs | 42 +++++++++++------- .../General/Vector128/Dot.Int16.cs | 42 +++++++++++------- .../General/Vector128/Dot.Int32.cs | 42 +++++++++++------- .../General/Vector128/Dot.Int64.cs | 42 +++++++++++------- .../General/Vector128/Dot.SByte.cs | 42 +++++++++++------- .../General/Vector128/Dot.Single.cs | 43 ++++++++++++------- .../General/Vector128/Dot.UInt16.cs | 42 +++++++++++------- .../General/Vector128/Dot.UInt32.cs | 42 +++++++++++------- .../General/Vector128/Dot.UInt64.cs | 42 +++++++++++------- .../General/Vector256/Dot.Byte.cs | 42 +++++++++++------- .../General/Vector256/Dot.Double.cs | 42 +++++++++++------- .../General/Vector256/Dot.Int16.cs | 42 +++++++++++------- .../General/Vector256/Dot.Int32.cs | 42 +++++++++++------- .../General/Vector256/Dot.Int64.cs | 42 +++++++++++------- .../General/Vector256/Dot.SByte.cs | 42 +++++++++++------- .../General/Vector256/Dot.Single.cs | 43 ++++++++++++------- .../General/Vector256/Dot.UInt16.cs | 42 +++++++++++------- .../General/Vector256/Dot.UInt32.cs | 42 +++++++++++------- .../General/Vector256/Dot.UInt64.cs | 42 +++++++++++------- .../General/Vector64/Dot.Byte.cs | 42 +++++++++++------- .../General/Vector64/Dot.Double.cs | 42 +++++++++++------- .../General/Vector64/Dot.Int16.cs | 42 +++++++++++------- .../General/Vector64/Dot.Int32.cs | 42 +++++++++++------- .../General/Vector64/Dot.Int64.cs | 42 +++++++++++------- .../General/Vector64/Dot.SByte.cs | 42 +++++++++++------- .../General/Vector64/Dot.Single.cs | 42 +++++++++++------- .../General/Vector64/Dot.UInt16.cs | 42 +++++++++++------- .../General/Vector64/Dot.UInt32.cs | 42 +++++++++++------- .../General/Vector64/Dot.UInt64.cs | 42 +++++++++++------- 30 files changed, 810 insertions(+), 452 deletions(-) diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs index 7b379ca30f7f18..a90aa91c290d12 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe { bool succeeded = true; - Byte actualResult = default; - Byte intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (Byte)(left[i] * right[i]); - } - - actualResult += intermResult; + Byte actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe Succeeded = false; } } + + private Byte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Byte)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Byte)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs index 0c181839059394..c78a7e781ea748 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle { bool succeeded = true; - Double actualResult = default; - Double intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (Double)(left[i] * right[i]); - } - - actualResult += intermResult; + Double actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle Succeeded = false; } } + + private Double ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Double)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Double)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs index 749c5bda7378d7..6af78ab044679a 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe { bool succeeded = true; - Int16 actualResult = default; - Int16 intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (Int16)(left[i] * right[i]); - } - - actualResult += intermResult; + Int16 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe Succeeded = false; } } + + private Int16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int16)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int16)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs index 95f0de0e628bad..1978ad812163d3 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe { bool succeeded = true; - Int32 actualResult = default; - Int32 intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (Int32)(left[i] * right[i]); - } - - actualResult += intermResult; + Int32 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe Succeeded = false; } } + + private Int32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int32)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int32)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs index 9f8c44c0df4532..33643deeff84a2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe { bool succeeded = true; - Int64 actualResult = default; - Int64 intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (Int64)(left[i] * right[i]); - } - - actualResult += intermResult; + Int64 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe Succeeded = false; } } + + private Int64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int64)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int64)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs index 5030c06dbe5b81..b23a0b74e01e05 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe { bool succeeded = true; - SByte actualResult = default; - SByte intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (SByte)(left[i] * right[i]); - } - - actualResult += intermResult; + SByte actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe Succeeded = false; } } + + private SByte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (SByte)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (SByte)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs index a8ff5b209389ea..7c812ec7f3946c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.Single.cs @@ -18,7 +18,6 @@ namespace JIT.HardwareIntrinsics.General._Vector128 { public static partial class Program { - [ActiveIssue("https://github.com/dotnet/runtime/issues/75791")] [Fact] public static void DotSingle() { @@ -71,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -294,20 +293,7 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle { bool succeeded = true; - Single actualResult = default; - Single intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (Single)(left[i] * right[i]); - } - - actualResult += intermResult; + Single actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -325,5 +311,30 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle Succeeded = false; } } + + private Single ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Single)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Single)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs index c1f73aa74a96ce..3af9759b78acb0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle { bool succeeded = true; - UInt16 actualResult = default; - UInt16 intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (UInt16)(left[i] * right[i]); - } - - actualResult += intermResult; + UInt16 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle Succeeded = false; } } + + private UInt16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt16)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt16)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs index bf8be929170872..cc003b8323afb6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle { bool succeeded = true; - UInt32 actualResult = default; - UInt32 intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (UInt32)(left[i] * right[i]); - } - - actualResult += intermResult; + UInt32 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle Succeeded = false; } } + + private UInt32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt32)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt32)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs index 6f610e0c19f1c3..8c7ba5a7e2983e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector128/Dot.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle { bool succeeded = true; - UInt64 actualResult = default; - UInt64 intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (UInt64)(left[i] * right[i]); - } - - actualResult += intermResult; + UInt64 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle Succeeded = false; } } + + private UInt64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt64)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt64)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs index d4e57461c765cc..048f964f45e177 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe { bool succeeded = true; - Byte actualResult = default; - Byte intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (Byte)(left[i] * right[i]); - } - - actualResult += intermResult; + Byte actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe Succeeded = false; } } + + private Byte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Byte)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Byte)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs index e6eb7a4c473aba..76f31b0ddd9087 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle { bool succeeded = true; - Double actualResult = default; - Double intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (Double)(left[i] * right[i]); - } - - actualResult += intermResult; + Double actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle Succeeded = false; } } + + private Double ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Double)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Double)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs index 226cffc5d4d817..ca2c92720a76a6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe { bool succeeded = true; - Int16 actualResult = default; - Int16 intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (Int16)(left[i] * right[i]); - } - - actualResult += intermResult; + Int16 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe Succeeded = false; } } + + private Int16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int16)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int16)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs index 0add06a6628061..1d29cb0741e8f2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe { bool succeeded = true; - Int32 actualResult = default; - Int32 intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (Int32)(left[i] * right[i]); - } - - actualResult += intermResult; + Int32 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe Succeeded = false; } } + + private Int32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int32)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int32)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs index 91faf9fe2b431e..a13094419838d0 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe { bool succeeded = true; - Int64 actualResult = default; - Int64 intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (Int64)(left[i] * right[i]); - } - - actualResult += intermResult; + Int64 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe Succeeded = false; } } + + private Int64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int64)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int64)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs index bc4db8729d73f3..57b5732ff478a4 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe { bool succeeded = true; - SByte actualResult = default; - SByte intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (SByte)(left[i] * right[i]); - } - - actualResult += intermResult; + SByte actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe Succeeded = false; } } + + private SByte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (SByte)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (SByte)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs index eb9cf19f744f0a..f6809a4ab2b073 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.Single.cs @@ -18,7 +18,6 @@ namespace JIT.HardwareIntrinsics.General._Vector256 { public static partial class Program { - [ActiveIssue("https://github.com/dotnet/runtime/issues/75791")] [Fact] public static void DotSingle() { @@ -71,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -294,20 +293,7 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle { bool succeeded = true; - Single actualResult = default; - Single intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (Single)(left[i] * right[i]); - } - - actualResult += intermResult; + Single actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -325,5 +311,30 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle Succeeded = false; } } + + private Single ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Single)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Single)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs index 8779fca1d0b8c2..ebbd03623ff53f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle { bool succeeded = true; - UInt16 actualResult = default; - UInt16 intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (UInt16)(left[i] * right[i]); - } - - actualResult += intermResult; + UInt16 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle Succeeded = false; } } + + private UInt16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt16)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt16)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs index 09a769c9916c01..115218d79fa27d 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle { bool succeeded = true; - UInt32 actualResult = default; - UInt32 intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (UInt32)(left[i] * right[i]); - } - - actualResult += intermResult; + UInt32 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle Succeeded = false; } } + + private UInt32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt32)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt32)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs index 26f8806b0b575b..61f8ceac1a4a59 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Dot.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle { bool succeeded = true; - UInt64 actualResult = default; - UInt64 intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (UInt64)(left[i] * right[i]); - } - - actualResult += intermResult; + UInt64 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle Succeeded = false; } } + + private UInt64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt64)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt64)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs index 8c1916f0a858b2..ded616bf9f2c5c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Byte.cs @@ -70,7 +70,7 @@ public DataTable(Byte[] inArray1, Byte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe { bool succeeded = true; - Byte actualResult = default; - Byte intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (Byte)(left[i] * right[i]); - } - - actualResult += intermResult; + Byte actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(Byte[] left, Byte[] right, Byte result, [CallerMembe Succeeded = false; } } + + private Byte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Byte)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Byte)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs index 3e16d1b52a0977..f2ffbf02bb4699 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Double.cs @@ -70,7 +70,7 @@ public DataTable(Double[] inArray1, Double[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle { bool succeeded = true; - Double actualResult = default; - Double intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (Double)(left[i] * right[i]); - } - - actualResult += intermResult; + Double actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(Double[] left, Double[] right, Double result, [Calle Succeeded = false; } } + + private Double ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Double)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Double)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs index 283182815302ee..48eb7f189fdde2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int16.cs @@ -70,7 +70,7 @@ public DataTable(Int16[] inArray1, Int16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe { bool succeeded = true; - Int16 actualResult = default; - Int16 intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (Int16)(left[i] * right[i]); - } - - actualResult += intermResult; + Int16 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(Int16[] left, Int16[] right, Int16 result, [CallerMe Succeeded = false; } } + + private Int16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int16)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int16)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs index 6cef7996fa5511..9811a236de9f36 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int32.cs @@ -70,7 +70,7 @@ public DataTable(Int32[] inArray1, Int32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe { bool succeeded = true; - Int32 actualResult = default; - Int32 intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (Int32)(left[i] * right[i]); - } - - actualResult += intermResult; + Int32 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(Int32[] left, Int32[] right, Int32 result, [CallerMe Succeeded = false; } } + + private Int32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int32)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int32)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs index 81afde657ea149..dc678c0aa7111c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Int64.cs @@ -70,7 +70,7 @@ public DataTable(Int64[] inArray1, Int64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe { bool succeeded = true; - Int64 actualResult = default; - Int64 intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (Int64)(left[i] * right[i]); - } - - actualResult += intermResult; + Int64 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(Int64[] left, Int64[] right, Int64 result, [CallerMe Succeeded = false; } } + + private Int64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Int64)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Int64)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs index 00cbbbb9d74c54..f2aad6a809f3c7 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.SByte.cs @@ -70,7 +70,7 @@ public DataTable(SByte[] inArray1, SByte[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe { bool succeeded = true; - SByte actualResult = default; - SByte intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (SByte)(left[i] * right[i]); - } - - actualResult += intermResult; + SByte actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(SByte[] left, SByte[] right, SByte result, [CallerMe Succeeded = false; } } + + private SByte ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (SByte)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (SByte)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs index 07eb92525d3df3..550450092bd975 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.Single.cs @@ -70,7 +70,7 @@ public DataTable(Single[] inArray1, Single[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle { bool succeeded = true; - Single actualResult = default; - Single intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (Single)(left[i] * right[i]); - } - - actualResult += intermResult; + Single actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(Single[] left, Single[] right, Single result, [Calle Succeeded = false; } } + + private Single ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (Single)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (Single)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs index faf377ba303073..8fd9072155837f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt16.cs @@ -70,7 +70,7 @@ public DataTable(UInt16[] inArray1, UInt16[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle { bool succeeded = true; - UInt16 actualResult = default; - UInt16 intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (UInt16)(left[i] * right[i]); - } - - actualResult += intermResult; + UInt16 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(UInt16[] left, UInt16[] right, UInt16 result, [Calle Succeeded = false; } } + + private UInt16 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt16)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt16)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs index 2cf6647483e17b..8d01c3bedeac6f 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt32.cs @@ -70,7 +70,7 @@ public DataTable(UInt32[] inArray1, UInt32[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle { bool succeeded = true; - UInt32 actualResult = default; - UInt32 intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (UInt32)(left[i] * right[i]); - } - - actualResult += intermResult; + UInt32 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(UInt32[] left, UInt32[] right, UInt32 result, [Calle Succeeded = false; } } + + private UInt32 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt32)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt32)(left[0] * right[0]); + } + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs index 8fddb15edc6d4f..b73d037c4a4ccc 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Dot.UInt64.cs @@ -70,7 +70,7 @@ public DataTable(UInt64[] inArray1, UInt64[] inArray2, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); - if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) + if (!int.IsPow2(alignment) || (alignment > 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2) { throw new ArgumentException("Invalid value of alignment"); } @@ -293,20 +293,7 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle { bool succeeded = true; - UInt64 actualResult = default; - UInt64 intermResult = default; - - for (var i = 0; i < Op1ElementCount; i++) - { - if ((i % Vector128.Count) == 0) - { - actualResult += intermResult; - intermResult = default; - } - intermResult += (UInt64)(left[i] * right[i]); - } - - actualResult += intermResult; + UInt64 actualResult = ComputeExpectedResult(left, right); if (actualResult != result) { @@ -324,5 +311,30 @@ private void ValidateResult(UInt64[] left, UInt64[] right, UInt64 result, [Calle Succeeded = false; } } + + private UInt64 ComputeExpectedResult(ReadOnlySpan left, ReadOnlySpan right) + { + // We need to do pairwise addition to compute the result. However, we need this done for the vector chunks + // as well. So we'll just recurse down to 1 element. This ensures that: + // * Vector512 is Vector256 + Vector256 + // * Vector256 is Vector128 + Vector128 + // * Vector128 is Vector64 + Vector64 + // * etc + // This continues down to `(left[n] * right[n]) + (left[n + 1] * right[n + 1])` + + if (left.Length != 1) + { + int half = left.Length / 2; + + return (UInt64)( + ComputeExpectedResult(left.Slice(0, half), right.Slice(0, half)) + + ComputeExpectedResult(left.Slice(half), right.Slice(half)) + ); + } + else + { + return (UInt64)(left[0] * right[0]); + } + } } } From 1124f4e073949a81553cb8fbe23b88c41cba56b2 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Wed, 23 Nov 2022 13:46:24 -0800 Subject: [PATCH 16/26] Fix Vector128 divide by scalar --- src/mono/mono/mini/simd-intrinsics.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mono/mono/mini/simd-intrinsics.c b/src/mono/mono/mini/simd-intrinsics.c index 0100743f839610..fe8b48079ecbc8 100644 --- a/src/mono/mono/mini/simd-intrinsics.c +++ b/src/mono/mono/mini/simd-intrinsics.c @@ -302,6 +302,16 @@ emit_simd_ins_for_binary_op (MonoCompile *cfg, MonoClass *klass, MonoMethodSigna break; case SN_Divide: case SN_op_Division: + if (strcmp ("Vector4", m_class_get_name (klass)) && strcmp ("Vector2", m_class_get_name (klass))) { + if ((fsig->params [0]->type == MONO_TYPE_GENERICINST) && (fsig->params [1]->type != MONO_TYPE_GENERICINST)) { + MonoInst* ins = emit_simd_ins (cfg, klass, OP_CREATE_SCALAR_UNSAFE, args [1]->dreg, -1); + ins->inst_c1 = arg_type; + ins = emit_simd_ins (cfg, klass, OP_XBINOP_BYSCALAR, args [0]->dreg, ins->dreg); + ins->inst_c0 = OP_FDIV; + return ins; + } else + return NULL; + } instc0 = OP_FDIV; break; case SN_Max: @@ -325,7 +335,8 @@ emit_simd_ins_for_binary_op (MonoCompile *cfg, MonoClass *klass, MonoMethodSigna ins = emit_simd_ins (cfg, klass, OP_XBINOP_BYSCALAR, ins->dreg, args [1]->dreg); ins->inst_c0 = OP_FMUL; return ins; - } + } else + return NULL; } instc0 = OP_FMUL; break; From c72c3e5fdc2257f0207102ddff614a6cc9f39fb3 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Thu, 5 Jan 2023 15:30:12 -0800 Subject: [PATCH 17/26] Ensure field layout tests exist for Vector256 and Vector512 --- .../CoreTestAssembly/InstanceFieldLayout.cs | 60 +++++++++ .../InstanceFieldLayoutTests.cs | 120 ++++++++++++++++++ .../fieldlayout/fieldlayouttests.cs | 42 +++++- 3 files changed, 220 insertions(+), 2 deletions(-) diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/InstanceFieldLayout.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/InstanceFieldLayout.cs index 249090e38eae51..a67197c0a1901b 100644 --- a/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/InstanceFieldLayout.cs +++ b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/InstanceFieldLayout.cs @@ -230,6 +230,18 @@ public class Class16Align { Vector128 vector16Align; } + + [StructLayout(LayoutKind.Sequential)] + public class Class32Align + { + Vector256 vector32Align; + } + + [StructLayout(LayoutKind.Sequential)] + public class Class64Align + { + Vector512 vector64Align; + } } namespace Auto @@ -358,17 +370,53 @@ public struct int8x16x2 public Vector128 _1; } + [StructLayout(LayoutKind.Auto)] + public struct int8x32x2 + { + public Vector256 _0; + public Vector256 _1; + } + + [StructLayout(LayoutKind.Auto)] + public struct int8x64x2 + { + public Vector512 _0; + public Vector512 _1; + } + public struct Wrapper_int8x16x2 { public int8x16x2 fld; } + public struct Wrapper_int8x32x2 + { + public int8x32x2 fld; + } + + public struct Wrapper_int8x64x2 + { + public int8x64x2 fld; + } + public struct Wrapper_int8x16x2_2 { public bool fld1; public int8x16x2 fld2; } + public struct Wrapper_int8x32x2_2 + { + public bool fld1; + public int8x32x2 fld2; + } + + public struct Wrapper_int8x64x2_2 + { + public bool fld1; + public int8x64x2 fld2; + } + [StructLayout(LayoutKind.Auto)] public struct StructByte { @@ -453,6 +501,18 @@ public class Class16Align { Vector128 vector16Align; } + + [StructLayout(LayoutKind.Sequential)] + public class Class32Align + { + Vector256 vector32Align; + } + + [StructLayout(LayoutKind.Sequential)] + public class Class64Align + { + Vector512 vector64Align; + } } namespace IsByRefLike diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/InstanceFieldLayoutTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/InstanceFieldLayoutTests.cs index e846cbfe31af93..f672130077ba86 100644 --- a/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/InstanceFieldLayoutTests.cs +++ b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/InstanceFieldLayoutTests.cs @@ -303,6 +303,50 @@ public void TestSequentialTypeLayoutClass16Align() } } + [Fact] + public void TestSequentialTypeLayoutClass32Align() + { + MetadataType classType = _testModule.GetType("Sequential", "Class32Align"); + Assert.Equal(0x28, classType.InstanceByteCount.AsInt); + foreach (var f in classType.GetFields()) + { + if (f.IsStatic) + continue; + + switch (f.Name) + { + case "vector32Align": + Assert.Equal(0x8, f.Offset.AsInt); + break; + default: + Assert.True(false); + break; + } + } + } + + [Fact] + public void TestSequentialTypeLayoutClass64Align() + { + MetadataType classType = _testModule.GetType("Sequential", "Class64Align"); + Assert.Equal(0x48, classType.InstanceByteCount.AsInt); + foreach (var f in classType.GetFields()) + { + if (f.IsStatic) + continue; + + switch (f.Name) + { + case "vector64Align": + Assert.Equal(0x8, f.Offset.AsInt); + break; + default: + Assert.True(false); + break; + } + } + } + [Fact] public void TestAutoLayoutStruct() { @@ -826,6 +870,50 @@ public void TestAutoTypeLayoutClass16Align() } } + [Fact] + public void TestAutoTypeLayoutClass32Align() + { + MetadataType classType = _testModule.GetType("Auto", "Class32Align"); + Assert.Equal(0x28, classType.InstanceByteCount.AsInt); + foreach (var f in classType.GetFields()) + { + if (f.IsStatic) + continue; + + switch (f.Name) + { + case "vector32Align": + Assert.Equal(0x8, f.Offset.AsInt); + break; + default: + Assert.True(false); + break; + } + } + } + + [Fact] + public void TestAutoTypeLayoutClass16Align() + { + MetadataType classType = _testModule.GetType("Auto", "Class64Align"); + Assert.Equal(0x48, classType.InstanceByteCount.AsInt); + foreach (var f in classType.GetFields()) + { + if (f.IsStatic) + continue; + + switch (f.Name) + { + case "vector64Align": + Assert.Equal(0x8, f.Offset.AsInt); + break; + default: + Assert.True(false); + break; + } + } + } + [Fact] public void TestTypeContainsGCPointers() { @@ -904,15 +992,47 @@ public void TestWrapperAroundVectorTypes() Assert.Equal(16, instantiatedType.InstanceFieldAlignment.AsInt); } + { + MetadataType type = (MetadataType)_testModule.GetType("System.Runtime.Intrinsics", "Vector256`1"); + MetadataType instantiatedType = type.MakeInstantiatedType(_context.GetWellKnownType(WellKnownType.Byte)); + Assert.Equal(32, instantiatedType.InstanceFieldAlignment.AsInt); + } + + { + MetadataType type = (MetadataType)_testModule.GetType("System.Runtime.Intrinsics", "Vector512`1"); + MetadataType instantiatedType = type.MakeInstantiatedType(_context.GetWellKnownType(WellKnownType.Byte)); + Assert.Equal(64, instantiatedType.InstanceFieldAlignment.AsInt); + } + { DefType type = _testModule.GetType("Auto", "int8x16x2"); Assert.Equal(16, type.InstanceFieldAlignment.AsInt); } + { + DefType type = _testModule.GetType("Auto", "int8x32x2"); + Assert.Equal(32, type.InstanceFieldAlignment.AsInt); + } + + { + DefType type = _testModule.GetType("Auto", "int8x64x2"); + Assert.Equal(64, type.InstanceFieldAlignment.AsInt); + } + { DefType type = _testModule.GetType("Auto", "Wrapper_int8x16x2"); Assert.Equal(16, type.InstanceFieldAlignment.AsInt); } + + { + DefType type = _testModule.GetType("Auto", "Wrapper_int8x32x2"); + Assert.Equal(32, type.InstanceFieldAlignment.AsInt); + } + + { + DefType type = _testModule.GetType("Auto", "Wrapper_int8x64x2"); + Assert.Equal(64, type.InstanceFieldAlignment.AsInt); + } } } } diff --git a/src/tests/readytorun/fieldlayout/fieldlayouttests.cs b/src/tests/readytorun/fieldlayout/fieldlayouttests.cs index 9b421859653648..cbd03e37abfeb3 100644 --- a/src/tests/readytorun/fieldlayout/fieldlayouttests.cs +++ b/src/tests/readytorun/fieldlayout/fieldlayouttests.cs @@ -12,7 +12,9 @@ static int Main() SequentialTest.Test(); AutoTest.Test(); EnumAlignmentTest.Test(); - AutoTestWithVector.Test(); + AutoTestWithVector128.Test(); + AutoTestWithVector256.Test(); + AutoTestWithVector512.Test(); return 100; } } @@ -160,7 +162,7 @@ public static void Test() } } -class AutoTestWithVector +class AutoTestWithVector128 { static Auto.int8x16x2 _fld1 = new Auto.int8x16x2(); static Auto.Wrapper_int8x16x2 _fld2 = new Auto.Wrapper_int8x16x2(); @@ -178,6 +180,42 @@ public static void Test() } } +class AutoTestWithVector256 +{ + static Auto.int8x32x2 _fld1 = new Auto.int8x32x2(); + static Auto.Wrapper_int8x32x2 _fld2 = new Auto.Wrapper_int8x32x2(); + static Auto.Wrapper_int8x32x2_2 _fld3 = new Auto.Wrapper_int8x32x2_2(); + + public static void Test() + { + _fld1._0 = new Vector256(); + _fld1._1 = new Vector256(); + + _fld2.fld = _fld1; + + _fld3.fld1 = true; + _fld3.fld2 = _fld1; + } +} + +class AutoTestWithVector512 +{ + static Auto.int8x64x2 _fld1 = new Auto.int8x64x2(); + static Auto.Wrapper_int8x64x2 _fld2 = new Auto.Wrapper_int8x64x2(); + static Auto.Wrapper_int8x64x2_2 _fld3 = new Auto.Wrapper_int8x64x2_2(); + + public static void Test() + { + _fld1._0 = new Vector512(); + _fld1._1 = new Vector512(); + + _fld2.fld = _fld1; + + _fld3.fld1 = true; + _fld3.fld2 = _fld1; + } +} + class SequentialTest { static Sequential.Class1 _fld1 = new Sequential.Class1(); From ad7e03d3be19e409667837f71f3ef293fdc2c470 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Mon, 9 Jan 2023 12:32:07 -0800 Subject: [PATCH 18/26] Updating the R2R version from 8.0 to 9.0 --- src/coreclr/inc/readytorun.h | 4 ++-- src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/coreclr/inc/readytorun.h b/src/coreclr/inc/readytorun.h index 21bd50642d4b72..2cbab17f8420a5 100644 --- a/src/coreclr/inc/readytorun.h +++ b/src/coreclr/inc/readytorun.h @@ -15,10 +15,10 @@ #define READYTORUN_SIGNATURE 0x00525452 // 'RTR' // Keep these in sync with src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs -#define READYTORUN_MAJOR_VERSION 0x0008 +#define READYTORUN_MAJOR_VERSION 0x0009 #define READYTORUN_MINOR_VERSION 0x0000 -#define MINIMUM_READYTORUN_MAJOR_VERSION 0x008 +#define MINIMUM_READYTORUN_MAJOR_VERSION 0x009 // R2R Version 2.1 adds the InliningInfo section // R2R Version 2.2 adds the ProfileDataInfo section diff --git a/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs b/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs index 144bd50f949db9..898be9f4cb3f93 100644 --- a/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs +++ b/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +.// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; @@ -14,7 +14,7 @@ internal struct ReadyToRunHeaderConstants { public const uint Signature = 0x00525452; // 'RTR' - public const ushort CurrentMajorVersion = 8; + public const ushort CurrentMajorVersion = 9; public const ushort CurrentMinorVersion = 0; } #if READYTORUN From b6b62fda4d900c5aa7efd42404c07eb7c6385118 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Mon, 9 Jan 2023 12:37:39 -0800 Subject: [PATCH 19/26] Ensure Vector512 tests are disabled in the same place as the Vector64/128/256 tests --- src/tests/issues.targets | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/tests/issues.targets b/src/tests/issues.targets index 96265b5f9edf3f..1777ba10480211 100644 --- a/src/tests/issues.targets +++ b/src/tests/issues.targets @@ -904,6 +904,12 @@ Not compatible with multifile testing. Problem with detecting that a JIT intrinsic is reflection-used. + + Not compatible with multifile testing. Problem with detecting that a JIT intrinsic is reflection-used. + + + Not compatible with multifile testing. Problem with detecting that a JIT intrinsic is reflection-used. + Not compatible with multifile testing. @@ -1078,6 +1084,12 @@ https://github.com/dotnet/runtimelab/issues/184 + + https://github.com/dotnet/runtimelab/issues/184 + + + https://github.com/dotnet/runtimelab/issues/184 + https://github.com/dotnet/runtimelab/issues/190 @@ -3085,7 +3097,7 @@ Needs coreclr build - + @@ -3330,6 +3342,9 @@ https://github.com/dotnet/runtime/issues/54867 + + https://github.com/dotnet/runtime/issues/54122 + https://github.com/dotnet/runtime/issues/54122 From 34579484822489f0ea2b48a2da87ab1a101a468e Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Mon, 9 Jan 2023 17:24:49 -0800 Subject: [PATCH 20/26] Remove a stray . --- src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs b/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs index 898be9f4cb3f93..a0222bacaaf5e2 100644 --- a/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs +++ b/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs @@ -1,4 +1,4 @@ -.// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; From 1b0adc081c94d9946c754c632f1a440cf613fc92 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Fri, 6 Jan 2023 21:39:47 -0800 Subject: [PATCH 21/26] Fixing the NativeAOT field layout tests --- .../CoreTestAssembly/Platform.cs | 18 ++++++++++++++++++ .../InstanceFieldLayoutTests.cs | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Platform.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Platform.cs index 2239925645c77c..75ade965f9318a 100644 --- a/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Platform.cs +++ b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Platform.cs @@ -182,4 +182,22 @@ public readonly struct Vector128 private readonly ulong _00; private readonly ulong _01; } + + [Intrinsic] + [StructLayout(LayoutKind.Sequential, Size = 32)] + public readonly struct Vector256 + where T : struct + { + private readonly Vector128 _lower; + private readonly Vector128 _upper; + } + + [Intrinsic] + [StructLayout(LayoutKind.Sequential, Size = 64)] + public readonly struct Vector512 + where T : struct + { + private readonly Vector256 _lower; + private readonly Vector256 _upper; + } } diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/InstanceFieldLayoutTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/InstanceFieldLayoutTests.cs index f672130077ba86..8c49d5ad91b818 100644 --- a/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/InstanceFieldLayoutTests.cs +++ b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/InstanceFieldLayoutTests.cs @@ -893,7 +893,7 @@ public void TestAutoTypeLayoutClass32Align() } [Fact] - public void TestAutoTypeLayoutClass16Align() + public void TestAutoTypeLayoutClass64Align() { MetadataType classType = _testModule.GetType("Auto", "Class64Align"); Assert.Equal(0x48, classType.InstanceByteCount.AsInt); From 6be8dec44e4f25846ce133e1cdd1d39b8e081f36 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Tue, 10 Jan 2023 08:54:11 -0800 Subject: [PATCH 22/26] Update an addition location where the R2R version is defined --- src/coreclr/inc/readytorun.h | 5 ++++- src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h | 5 +++-- src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/coreclr/inc/readytorun.h b/src/coreclr/inc/readytorun.h index 2cbab17f8420a5..4754e0a294fe8f 100644 --- a/src/coreclr/inc/readytorun.h +++ b/src/coreclr/inc/readytorun.h @@ -14,7 +14,9 @@ #define READYTORUN_SIGNATURE 0x00525452 // 'RTR' -// Keep these in sync with src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs +// Keep these in sync with +// src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs +// src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h #define READYTORUN_MAJOR_VERSION 0x0009 #define READYTORUN_MINOR_VERSION 0x0000 @@ -27,6 +29,7 @@ // R2R Version 6.0 changes managed layout for sequential types with any unmanaged non-blittable fields. // R2R 6.0 is not backward compatible with 5.x or earlier. // R2R Version 8.0 Changes the alignment of the Int128 type +// R2R Version 9.0 adds support for the Vector512 type struct READYTORUN_CORE_HEADER { diff --git a/src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h b/src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h index 6f77813cd06143..7d0c985486c9d1 100644 --- a/src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h +++ b/src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h @@ -4,13 +4,14 @@ // // Please keep the data structures in this file in sync with the managed version at // src/Common/src/Internal/Runtime/ModuleHeaders.cs -// +// src/coreclr/inc/readytorun.h + struct ReadyToRunHeaderConstants { static const uint32_t Signature = 0x00525452; // 'RTR' - static const uint32_t CurrentMajorVersion = 8; + static const uint32_t CurrentMajorVersion = 9; static const uint32_t CurrentMinorVersion = 0; }; diff --git a/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs b/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs index a0222bacaaf5e2..f1985389496664 100644 --- a/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs +++ b/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs @@ -8,6 +8,7 @@ namespace Internal.Runtime // // Please keep the data structures in this file in sync with the native version at // src/coreclr/inc/readytorun.h + // src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h // internal struct ReadyToRunHeaderConstants From 2527bcd264bd148b6f69a6025a10a3ab6be6e043 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Tue, 10 Jan 2023 14:38:53 -0800 Subject: [PATCH 23/26] Disable Vector512 tests for llvmfullaot due to https://github.com/dotnet/runtime/issues/80467 --- src/tests/issues.targets | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tests/issues.targets b/src/tests/issues.targets index 176c81b2a90bdd..d1040b1a6dbe7a 100644 --- a/src/tests/issues.targets +++ b/src/tests/issues.targets @@ -3024,6 +3024,13 @@ https://github.com/dotnet/runtime/issues/64179 + + https://github.com/dotnet/runtime/issues/80467 + + + https://github.com/dotnet/runtime/issues/80467 + + https://github.com/dotnet/runtime/issues/52977 From d1fc03d003a1048ea2bdca34190f046adf26bd94 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Tue, 10 Jan 2023 22:22:55 -0500 Subject: [PATCH 24/26] Increase the value of ngsharedvt-trampolines --- src/tests/build.proj | 2 +- src/tests/issues.targets | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/tests/build.proj b/src/tests/build.proj index 63b799dc835d00..08981181e706f1 100644 --- a/src/tests/build.proj +++ b/src/tests/build.proj @@ -135,7 +135,7 @@ - + diff --git a/src/tests/issues.targets b/src/tests/issues.targets index d1040b1a6dbe7a..176c81b2a90bdd 100644 --- a/src/tests/issues.targets +++ b/src/tests/issues.targets @@ -3024,13 +3024,6 @@ https://github.com/dotnet/runtime/issues/64179 - - https://github.com/dotnet/runtime/issues/80467 - - - https://github.com/dotnet/runtime/issues/80467 - - https://github.com/dotnet/runtime/issues/52977 From 399e4c50326bd1667ea97caeb24bf555f5c1c397 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Wed, 11 Jan 2023 06:30:49 -0800 Subject: [PATCH 25/26] Move various HWIntrinsics to outerloop for unaccelerated platforms --- .../JIT/HardwareIntrinsics/Arm/Directory.Build.targets | 6 ++++++ .../General/Vector256/Vector256_r.csproj | 6 ++++++ .../General/Vector256/Vector256_ro.csproj | 6 ++++++ .../General/Vector256_1/Vector256_1_r.csproj | 6 ++++++ .../General/Vector256_1/Vector256_1_ro.csproj | 6 ++++++ .../General/Vector512/Vector512_r.csproj | 5 +++++ .../General/Vector512/Vector512_ro.csproj | 5 +++++ .../General/Vector512_1/Vector512_1_r.csproj | 5 +++++ .../General/Vector512_1/Vector512_1_ro.csproj | 5 +++++ .../HardwareIntrinsics/General/Vector64/Vector64_r.csproj | 5 +++++ .../HardwareIntrinsics/General/Vector64/Vector64_ro.csproj | 5 +++++ .../General/Vector64_1/Vector64_1_r.csproj | 5 +++++ .../General/Vector64_1/Vector64_1_ro.csproj | 5 +++++ .../JIT/HardwareIntrinsics/X86/Directory.Build.targets | 7 +++++++ 14 files changed, 77 insertions(+) diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Directory.Build.targets b/src/tests/JIT/HardwareIntrinsics/Arm/Directory.Build.targets index eca47c9c796adc..d72d49174ce0d0 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Directory.Build.targets +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Directory.Build.targets @@ -3,6 +3,12 @@ + + + 1 + 0 + + $(IntermediateOutputPath)$(MSBuildProjectName)/gen/ $(GeneratedHWIntrinsicTestDirectory)GeneratedHWIntrinsicTestList.txt diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Vector256_r.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Vector256_r.csproj index f9279746698a82..1ad7b2601c177e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Vector256_r.csproj +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Vector256_r.csproj @@ -7,6 +7,12 @@ Embedded + + + 1 + 0 + 0 + diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Vector256_ro.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Vector256_ro.csproj index d03724b0eb94fc..daa0b7f4d8c151 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256/Vector256_ro.csproj +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256/Vector256_ro.csproj @@ -7,6 +7,12 @@ Embedded True + + + 1 + 0 + 0 + diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_r.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_r.csproj index 9135dffd9f7179..031be37c976c33 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_r.csproj +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_r.csproj @@ -11,6 +11,12 @@ Embedded + + + 1 + 0 + 0 + diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_ro.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_ro.csproj index 39657cac03cb48..a99b519a5a2b7c 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_ro.csproj +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_ro.csproj @@ -11,6 +11,12 @@ Embedded True + + + 1 + 0 + 0 + diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Vector512_r.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Vector512_r.csproj index d126956039ccc3..8d6eceaa60a0da 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Vector512_r.csproj +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Vector512_r.csproj @@ -7,6 +7,11 @@ Embedded + + + + 1 + diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Vector512_ro.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Vector512_ro.csproj index 9eaa66e04befdc..51c2ea352d5870 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512/Vector512_ro.csproj +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512/Vector512_ro.csproj @@ -7,6 +7,11 @@ Embedded True + + + + 1 + diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Vector512_1_r.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Vector512_1_r.csproj index e224c93fc0dc6b..94400c3973315e 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Vector512_1_r.csproj +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Vector512_1_r.csproj @@ -7,6 +7,11 @@ Embedded + + + + 1 + diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Vector512_1_ro.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Vector512_1_ro.csproj index 02be430d75b7fb..26184da1cda7b2 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Vector512_1_ro.csproj +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector512_1/Vector512_1_ro.csproj @@ -7,6 +7,11 @@ Embedded True + + + + 1 + diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Vector64_r.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Vector64_r.csproj index 276cca082987b2..d71eca99ae9130 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Vector64_r.csproj +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Vector64_r.csproj @@ -7,6 +7,11 @@ Embedded + + + 1 + 0 + diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Vector64_ro.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Vector64_ro.csproj index f387846f6cb657..0ecd27a1733a37 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64/Vector64_ro.csproj +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64/Vector64_ro.csproj @@ -7,6 +7,11 @@ Embedded True + + + 1 + 0 + diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/Vector64_1_r.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/Vector64_1_r.csproj index 6446da14a204d0..07d32d1a24b8e6 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/Vector64_1_r.csproj +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/Vector64_1_r.csproj @@ -7,6 +7,11 @@ Embedded + + + 1 + 0 + diff --git a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/Vector64_1_ro.csproj b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/Vector64_1_ro.csproj index 03657d61396342..89d71c8f7af65b 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/Vector64_1_ro.csproj +++ b/src/tests/JIT/HardwareIntrinsics/General/Vector64_1/Vector64_1_ro.csproj @@ -7,6 +7,11 @@ Embedded True + + + 1 + 0 + diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Directory.Build.targets b/src/tests/JIT/HardwareIntrinsics/X86/Directory.Build.targets index 933c13be21e6a0..77fd5e210fc556 100644 --- a/src/tests/JIT/HardwareIntrinsics/X86/Directory.Build.targets +++ b/src/tests/JIT/HardwareIntrinsics/X86/Directory.Build.targets @@ -3,6 +3,13 @@ + + + 1 + 0 + 0 + + $(IntermediateOutputPath)$(MSBuildProjectName)/gen/ $(GeneratedHWIntrinsicTestDirectory)GeneratedHWIntrinsicTestList.txt From 9bb141c382fe3562ce76ffe658454fa3f18909cd Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Wed, 11 Jan 2023 09:00:25 -0800 Subject: [PATCH 26/26] Ensure the HardwareIntrinsics tests are being filtered to outerloop where appropriate --- .../HardwareIntrinsics_r.csproj | 19 +++++++++++++++ .../HardwareIntrinsics_ro.csproj | 24 ++++++++++++++++--- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/src/tests/JIT/HardwareIntrinsics/HardwareIntrinsics_r.csproj b/src/tests/JIT/HardwareIntrinsics/HardwareIntrinsics_r.csproj index 9e996f24f8e982..e35247ff207100 100644 --- a/src/tests/JIT/HardwareIntrinsics/HardwareIntrinsics_r.csproj +++ b/src/tests/JIT/HardwareIntrinsics/HardwareIntrinsics_r.csproj @@ -4,9 +4,28 @@ 20 true true + + <_IncludeArm64HWIntrinsicTests>false + <_IncludeArm64HWIntrinsicTests Condition="'$(CLRTestPriorityToBuild)' >= '1' OR '$(TargetArchitecture)' == 'arm64'">true + <_IncludeXarchHWIntrinsicTests>false + <_IncludeXarchHWIntrinsicTests Condition="'$(CLRTestPriorityToBuild)' >= '1' OR '$(TargetArchitecture)' == 'x64' OR ('$(TargetArchitecture)' == 'x86' AND '$(TargetsWindows)' == 'true')">true + + + + + + + + + + + + + + diff --git a/src/tests/JIT/HardwareIntrinsics/HardwareIntrinsics_ro.csproj b/src/tests/JIT/HardwareIntrinsics/HardwareIntrinsics_ro.csproj index b578af1d705994..703427def42bae 100644 --- a/src/tests/JIT/HardwareIntrinsics/HardwareIntrinsics_ro.csproj +++ b/src/tests/JIT/HardwareIntrinsics/HardwareIntrinsics_ro.csproj @@ -4,11 +4,29 @@ 20 true true + + <_IncludeArm64HWIntrinsicTests>false + <_IncludeArm64HWIntrinsicTests Condition="'$(CLRTestPriorityToBuild)' >= '1' OR '$(TargetArchitecture)' == 'arm64'">true + <_IncludeXarchHWIntrinsicTests>false + <_IncludeXarchHWIntrinsicTests Condition="'$(CLRTestPriorityToBuild)' >= '1' OR '$(TargetArchitecture)' == 'x64' OR ('$(TargetArchitecture)' == 'x86' AND '$(TargetsWindows)' == 'true')">true + - - - + + + + + + + + + + + + + + +